diff --git a/unpublish.js b/unpublish.js new file mode 100644 index 0000000000000000000000000000000000000000..be1143b45b44b6ae02c2c92931073270d5bce6d7 --- /dev/null +++ b/unpublish.js @@ -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}`) + } +})();