Skip to content

Commit

Permalink
IMPROVE reset script
Browse files Browse the repository at this point in the history
  • Loading branch information
ndelangen committed Jun 16, 2019
1 parent 19075e4 commit 5c14190
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions scripts/reset.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,19 @@ cleaningProcess.stdout.on('data', data => {
const [, uri] = i.match(/Would remove (.*)$/) || [];

if (uri) {
if (uri.match(/node_modules/)) {
if (uri.match(/\/node_modules\//) || uri.match(/\/dist\//)) {
del(uri).then(() => {
console.log(`deleted ${uri}`);
});
} else {
trash(uri).then(() => {
console.log(`trashed ${uri}`);
});
trash(uri)
.then(() => {
console.log(`trashed ${uri}`);
})
.catch(e => {
console.log('failed to trash, will try permanent delete');
trash(uri);
});
}
}
});
Expand Down

0 comments on commit 5c14190

Please sign in to comment.