Skip to content

Commit

Permalink
add unpublish.js
Browse files Browse the repository at this point in the history
  • Loading branch information
fxy060608 committed Oct 19, 2019
1 parent dc31f5e commit 4c9e4e6
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions unpublish.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
const fs = require('fs')
const path = require('path')
const shellExec = require('shell-exec')

const pkgs = fs.readdirSync(path.resolve(__dirname, 'packages'))

const version = process.argv[2]
if (!version) {
throw new Error('必须传入 version')
}

(async function() {
for (let i = 0; i < pkgs.length; i++) {
console.log(`npm unpublish @dcloudio/${pkgs[i]}@${version}`);
await shellExec(`npm unpublish @dcloudio/${pkgs[i]}@${version}`)
}
})();

0 comments on commit 4c9e4e6

Please sign in to comment.