src/Pure/System/isabelle_system.ML
changeset 70050 5b66e6672ccf
parent 66679 ed8d359d92e4
child 71902 1529336eaedc
--- a/src/Pure/System/isabelle_system.ML	Wed Apr 03 23:35:13 2019 +0200
+++ b/src/Pure/System/isabelle_system.ML	Thu Apr 04 14:29:49 2019 +0200
@@ -15,6 +15,7 @@
   val create_tmp_path: string -> string -> Path.T
   val with_tmp_file: string -> string -> (Path.T -> 'a) -> 'a
   val with_tmp_dir: string -> (Path.T -> 'a) -> 'a
+  val bash_output_check: string -> string
   val bash_output: string -> string * int
   val bash: string -> int
 end;
@@ -24,6 +25,11 @@
 
 (* bash *)
 
+fun bash_output_check s =
+  (case Bash.process s of
+    {rc = 0, out, ...} => (trim_line out)
+  | {err, ...} => error (trim_line err));
+
 fun bash_output s =
   let
     val {out, err, rc, ...} = Bash.process s;