1 Star 0 Fork 0

Bokecn/yapi

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
npm-publish.js 841 Bytes
一键复制 编辑 原始数据 按行查看 历史
suwenxiong 提交于 2019-01-15 14:25 . fix: npm publish bug
const shell = require ('shelljs');
const packageJson = require ('./package.json');
const version = "v" + packageJson.version;
if(!version){
console.error('version 不能为空')
process.exit(1)
}
shell.exec ('npm install --registry https://registry.npm.taobao.org');
shell.exec ('npm run build-client');
shell.exec ('git add .');
shell.exec ('git commit -a -m "chore: update static file"');
console.log ('exec: git pull origin master');
shell.exec ('git pull origin master');
let a = shell.exec (`git tag |grep ${version} |wc -l`);
if (a && parseInt (a) > 0) {
shell.exec ('git tag -d ' + version);
shell.exec ('git push origin :' + version);
}
shell.exec ('git tag ' + version);
shell.exec ('git push origin ' + version);
console.log('git push success', version)
console.log('正在执行npm发布')
shell.exec('npm publish')
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/xinpeng/yapi.git
git@gitee.com:xinpeng/yapi.git
xinpeng
yapi
yapi
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385