equal
deleted
inserted
replaced
112 |
112 |
113 (* download file *) |
113 (* download file *) |
114 |
114 |
115 fun download url = |
115 fun download url = |
116 with_tmp_file "download" "" (fn path => |
116 with_tmp_file "download" "" (fn path => |
117 let |
117 (Scala.function "download" (url ^ "\000" ^ Path.implode (File.absolute_path path)); |
118 val s = "curl --fail --silent --location " ^ Bash.string url ^ " > " ^ File.bash_path path; |
118 File.read path)); |
119 val res = bash_process s; |
|
120 in |
|
121 if Process_Result.ok res then File.read path |
|
122 else cat_error ("Failed to download " ^ quote url) (Process_Result.err res) |
|
123 end); |
|
124 |
119 |
125 end; |
120 end; |