summaryrefslogtreecommitdiff
path: root/src/Script
diff options
context:
space:
mode:
Diffstat (limited to 'src/Script')
-rw-r--r--src/Script/Shell.hs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/Script/Shell.hs b/src/Script/Shell.hs
index 8f25ab5..b00dc5f 100644
--- a/src/Script/Shell.hs
+++ b/src/Script/Shell.hs
@@ -23,18 +23,20 @@ import Network
import Output
import Process
import Run.Monad
+import Script.Var
data ShellStatement = ShellStatement
{ shellCommand :: Text
, shellArguments :: [ Text ]
+ , shellSourceLine :: SourceLine
}
newtype ShellScript = ShellScript [ ShellStatement ]
executeScript :: Node -> ProcName -> MVar ExitCode -> Handle -> Handle -> Handle -> ShellScript -> TestRun ()
-executeScript node _ statusVar pstdin pstdout pstderr (ShellScript statements) = do
+executeScript node pname statusVar pstdin pstdout pstderr (ShellScript statements) = do
forM_ statements $ \ShellStatement {..} -> case shellCommand of
"echo" -> liftIO $ do
T.hPutStrLn pstdout $ T.intercalate " " shellArguments
@@ -51,6 +53,7 @@ executeScript node _ statusVar pstdin pstdout pstderr (ShellScript statements) =
liftIO (waitForProcess phandle) >>= \case
ExitSuccess -> return ()
status -> do
+ outLine OutputChildFail (Just $ textProcName pname) $ "failed at: " <> textSourceLine shellSourceLine
liftIO $ putMVar statusVar status
throwError Failed
liftIO $ putMVar statusVar ExitSuccess