let wget_to_folder
~host ~(run_program : Machine.Make_fun.t)
~test_file ~destination url =
let open KEDSL in
let name = "wget-" ^ Filename.basename destination in
let test_target = destination // test_file in
workflow_node (single_file test_target ~host) ~name
~make:(
run_program ~name
~requirements:(Machine.Make_fun.downloading [])
Program.(
exec ["mkdir"; "-p"; destination]
&& shf "wget %s -P %s"
(Filename.quote url)
(Filename.quote destination)))
~edges:[
on_failure_activate (Remove.path_on_host ~host destination);
]