let run args target =
reset_readdir_cache ();
let cmd = String.concat " " (List.map quote_filename_if_needed args) in
if !*My_unix.is_degraded || Sys.os_type = "Win32" then
begin
Log.event cmd target Tags.empty;
let st = sys_command cmd in
if st <> 0 then
failwith (Printf.sprintf "Error during command `%s'.\nExit code %d.\n" cmd st)
else
()
end
else
match My_unix.execute_many ~ticker:Log.update ~display:Log.display [[(fun () -> cmd)]] with
| None -> ()
| Some(_, x) ->
failwith (Printf.sprintf "Error during command %S: %s" cmd (Printexc.to_string x))