1
0
mirror of https://github.com/142vip/408CSFamily.git synced 2026-04-25 03:00:00 +08:00

feat: 新增release发布脚本

This commit is contained in:
chufan
2023-09-05 09:48:50 +08:00
parent 42934f96d9
commit d94f30aa20
7 changed files with 130 additions and 26 deletions

36
scripts/.exec Executable file
View File

@@ -0,0 +1,36 @@
#!/usr/bin/env node
const {join} = require('path')
const cwd = join(__dirname, '..')
process.env.PATH = `${join(cwd, 'node_modules', '.bin')}:${process.env.PATH}`
const {exec,exit} = require('shelljs');
/**
* 监听进程
* - 退出进程
*/
process.on('exit', () => {
exit()
})
/**
* 执行shell指令
* @param commands
*/
exports.execShell = commands => {
let runCommands=[]
if(typeof commands ==='string'){
runCommands.push(commands)
}
// 批量执行
if(Array.isArray(commands)){
runCommands=commands
}
for (const command of runCommands) {
console.log(`------- command: >>> ${command} <<< start -------`)
exec(command)
console.log(`------- command: >>> ${command} <<< ending -------`)
}
}