wgh_valicator
Version:
form valicator
28 lines (19 loc) • 645 B
JavaScript
// npm包发布脚本
// 命令: node shell.js 1.0.1
console.log(process.argv[2])
const version = process.argv[2]
const shell = require('shelljs');
// // 修改版本号
shell.sed('-i', /"version": "\d\.\d\.\d"/, `"version": "${version}"`, 'package.json')
// npm 登陆
// const username = 'wuganghuang'
// const password = 'wu138168'
// const email = '815600709@qq.com'
// var child = shell.exec('npm login', { async: true });
// child.stdout.on('data', function (data) {
// shell.echo(username)
// shell.echo(password)
// shell.echo(email)
// shell.exit()
// });
shell.exec(`npm publish`)