From e4455409fe6fe9c198b250b488129171f0b4624a Mon Sep 17 00:00:00 2001 From: NoDocCat Date: Mon, 4 Nov 2019 16:15:54 +0800 Subject: [PATCH] fix: on uninstall package, *.ps1 not delete PR-URL: https://github.com/npm/cli/pull/281 Credit: @NoDocCat Close: #281 Reviewed-by: @ruyadorno --- lib/unbuild.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/unbuild.js b/lib/unbuild.js index e06ee5eb30e20..3e8d3e4f1f3ed 100644 --- a/lib/unbuild.js +++ b/lib/unbuild.js @@ -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) }