Skip to content

Commit

Permalink
fix: on uninstall package, *.ps1 not delete
Browse files Browse the repository at this point in the history
PR-URL: #281
Credit: @NoDocCat
Close: #281
Reviewed-by: @ruyadorno
  • Loading branch information
suiyun39 authored and ruyadorno committed Nov 5, 2019
1 parent d3cb3ab commit e445540
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/unbuild.js
Expand Up @@ -78,8 +78,11 @@ function rmBins (pkg, folder, parent, top, cb) {
const binRoot = top ? npm.bin : path.resolve(parent, '.bin')
asyncMap(Object.keys(pkg.bin), function (b, cb) {
if (process.platform === 'win32') {
chain([ [gentlyRm, path.resolve(binRoot, b) + '.cmd', true, folder],
[gentlyRm, path.resolve(binRoot, b), true, folder] ], cb)
chain([
[gentlyRm, path.resolve(binRoot, b) + '.ps1', true, folder],
[gentlyRm, path.resolve(binRoot, b) + '.cmd', true, folder],
[gentlyRm, path.resolve(binRoot, b), true, folder]
], cb)
} else {
gentlyRm(path.resolve(binRoot, b), true, folder, cb)
}
Expand Down

0 comments on commit e445540

Please sign in to comment.