You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

16 lines
448 B

6 years ago
let extractFile = (~into as destination, filepath) => {
let%lwt _ = System.mkdirp(destination);
let%lwt _ =
System.unix_exec(
"tar",
~args=[|"-xvf", filepath, "--directory", destination|],
~stderr=`Dev_null,
);
let%lwt files = Fs.readdir(destination) |> Result.toLwt;
let filename = files[0];
Lwt_unix.rename(
Filename.concat(destination, filename),
Filename.concat(destination, "installation"),
);
};