Skip to content

Commit

Permalink
@slowtest Use vendored bos to remove files/directories
Browse files Browse the repository at this point in the history
Vendored bos has fixes for readonly files on Windows. Issue last seen
with esy i --cache-tarballs-path
  • Loading branch information
ManasJayanth committed Jun 14, 2021
1 parent ca4e8ef commit d44ad86
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions esy-lib/Fs.re
Expand Up @@ -388,17 +388,17 @@ let rec rmPathLwt = path => {
};
};

let rmPath = path =>
try%lwt(
{
let%lwt () = rmPathLwt(path);
RunAsync.return();
}
) {
| Unix.Unix_error(Unix.ENOENT, _, _) => RunAsync.return()
| Unix.Unix_error(error, _, _) =>
RunAsync.error(Unix.error_message(error))
};
let rmPath = path => {
/* `Fs.rmPath` needs the same fix we made for `Bos.OS.Path.delete`
* readonly files need to have their readonly bit off just before
* deleting. (https://github.com/esy/esy/pull/1122)
* Temporarily commenting `Fs.rmPath` and using the Bos
* equivalent as a stopgap.
*/
Bos.OS.Path.delete(~must_exist=false, ~recurse=true, path)
|> Run.ofBosError
|> Lwt.return
}

let randGen = lazy(Random.State.make_self_init());

Expand Down

0 comments on commit d44ad86

Please sign in to comment.