From: Richard W.M. Jones Date: Sat, 28 Dec 2019 08:50:19 +0000 (+0000) Subject: Run code with set -e / set -x. X-Git-Tag: v'0.2'~125 X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=c261da4d0efea4d86131abbbc2912edfa863995e;p=goals.git Run code with set -e / set -x. --- diff --git a/src/eval.ml b/src/eval.ml index 9fc6e5c..46455f7 100644 --- a/src/eval.ml +++ b/src/eval.ml @@ -96,7 +96,7 @@ and run_goal env loc name args (params, patterns, deps, code) = | [] -> env | d :: _ -> Ast.Env.add "^" d env in let code = Ast.to_shell_script env loc code in - printf "%s\n%!" (trim code); + let code = "set -e\nset -x\n\n" ^ code in let r = Sys.command code in if r <> 0 then ( eprintf "*** goal ‘%s’ failed with exit code %d\n" name r;