You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
461 B
17 lines
461 B
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}`)
|
|
}
|
|
})();
|
|
|