-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix how
output_as_string
deals with “failures”
`output_as_string` now does not kill the script if the command fails; this gives more power to the user who can still implement the previous behavior easily. Cf. the tests: ```ocaml exits 77 Construct.( let tmp = "/tmp/test_error_in_output_as_string" in let cat_tmp = exec ["cat"; tmp] in let succeed_or_die ut = if_then_else (succeeds ut) nop (seq [ printf "Failure !"; fail; ]) in seq [ exec ["rm"; "-f"; tmp]; if_then_else (seq [printf "aaa"; cat_tmp] |> succeed_or_die |> output_as_string =$= string "aaa") (return 11) (return 12); ]; ); ```
- Loading branch information
Showing
2 changed files
with
44 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters