summaryrefslogtreecommitdiff
path: root/src/Script
diff options
context:
space:
mode:
Diffstat (limited to 'src/Script')
-rw-r--r--src/Script/Shell.hs12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/Script/Shell.hs b/src/Script/Shell.hs
index f070de5..dbecee3 100644
--- a/src/Script/Shell.hs
+++ b/src/Script/Shell.hs
@@ -158,7 +158,17 @@ executeCommand sei@ShellExecInfo {..} st pstdin pstdout pstderr scmd@ShellComman
executeCommandProcess :: ShellExecInfo -> ShellState -> Handle -> Handle -> Handle -> [ Text ] -> Text -> TestRun ( TestRun ProcessStatus, ShellState )
-executeCommandProcess ShellExecInfo {..} st@ShellState {..} pstdin pstdout pstderr args = \case
+executeCommandProcess sei@ShellExecInfo {..} st@ShellState {..} pstdin pstdout pstderr args = \case
+ "!"
+ | (cmd : args') <- args -> do
+ ( exit, st' ) <- executeCommandProcess sei st pstdin pstdout pstderr args' cmd
+ let exit' = exit >>= \case Exited ExitSuccess -> return (Exited (ExitFailure (-1)))
+ _ -> return (Exited ExitSuccess)
+ return ( exit', st' )
+
+ | [] <- args -> do
+ return ( return (Exited (ExitFailure (-1))), st )
+
"cd"
| [] <- args -> liftIO $ do
hPutStrLn pstdout (nodeDir seiNode)