Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
benmccann committed Jun 28, 2024
1 parent 6f22d12 commit 41a14fe
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion lib/clean.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@ function clean(gyp, argv, callback) {
exists(to_delete, (found) => {
if (found) {
if (!gyp.opts.silent_clean) console.log('[' + package_json.name + '] Removing "%s"', to_delete);
fs.rm(to_delete, { recursive: true, force: true }, callback);
try {
fs.rmSync(to_delete, { recursive: true, force: true });
} catch (err) {
return callback(err);
}
}
return callback();
});
Expand Down
4 changes: 2 additions & 2 deletions lib/util/napi.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,14 +166,14 @@ module.exports.get_napi_build_version_from_command_args = function(command_args)

module.exports.swap_build_dir_out = function(napi_build_version) {
if (napi_build_version) {
fs.rm(module.exports.get_build_dir(napi_build_version), { recursive: true, force: true });
fs.rmSync(module.exports.get_build_dir(napi_build_version), { recursive: true, force: true });
fs.renameSync('build', module.exports.get_build_dir(napi_build_version));
}
};

module.exports.swap_build_dir_in = function(napi_build_version) {
if (napi_build_version) {
fs.rm('build', { recursive: true, force: true });
fs.rmSync('build', { recursive: true, force: true });
fs.renameSync(module.exports.get_build_dir(napi_build_version), 'build');
}
};
Expand Down

0 comments on commit 41a14fe

Please sign in to comment.