mirror of
https://github.com/142vip/408CSFamily.git
synced 2026-04-24 02:30:36 +08:00
feat: 新增markdown转思维导图脚本,导航栏改版
This commit is contained in:
@@ -5,54 +5,53 @@
|
||||
const {join} = require('path')
|
||||
const cwd = join(__dirname, '..')
|
||||
process.env.PATH = `${join(cwd, 'node_modules', '.bin')}:${process.env.PATH}`
|
||||
const {exec,exit} = require('shelljs');
|
||||
const {exec, exit} = require('shelljs');
|
||||
|
||||
/**
|
||||
* 监听进程
|
||||
* - 退出进程
|
||||
*/
|
||||
process.on('exit', () => {
|
||||
exit()
|
||||
exit()
|
||||
})
|
||||
|
||||
/**
|
||||
* 执行shell指令
|
||||
* @param commands
|
||||
*/
|
||||
exports.execShell = async commands => {
|
||||
let runCommands=[]
|
||||
if(typeof commands ==='string'){
|
||||
runCommands.push(commands)
|
||||
}
|
||||
let runCommands = []
|
||||
if (typeof commands === 'string') {
|
||||
runCommands.push(commands)
|
||||
}
|
||||
|
||||
// 批量执行
|
||||
if(Array.isArray(commands)){
|
||||
runCommands=commands
|
||||
}
|
||||
// 批量执行
|
||||
if (Array.isArray(commands)) {
|
||||
runCommands = commands
|
||||
}
|
||||
|
||||
for (let index=0;index<runCommands.length;index++) {
|
||||
const command=runCommands[index]
|
||||
const count=index+1
|
||||
console.log(`>>>command(${count}):\n${command} \n<<<command(${count})--start === \n`)
|
||||
// await syncExec(command)
|
||||
const execResult=await exec(command)
|
||||
for (let index = 0; index < runCommands.length; index++) {
|
||||
const command = runCommands[index]
|
||||
const count = index + 1
|
||||
console.log(`>>>command(${count}):\n${command} \n<<<command(${count})--start === \n`)
|
||||
// await syncExec(command)
|
||||
const execResult = await exec(command)
|
||||
|
||||
console.log(`\n<<<command(${count})--ending === `)
|
||||
// 指令异常,不执行后续指令
|
||||
if(execResult.code!==0){
|
||||
break;
|
||||
}
|
||||
console.log(`\n<<<command(${count})--ending === `)
|
||||
// 指令异常,不执行后续指令
|
||||
if (execResult.code !== 0) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 脚本基础设置
|
||||
*/
|
||||
exports.BaseSetting={
|
||||
successLogger:"\033[36m",
|
||||
errorLogger:"\033[1;31m",
|
||||
warnLogger:"\033[1;33m",
|
||||
exports.BaseSetting = {
|
||||
successLogger: "\033[36m",
|
||||
errorLogger: "\033[1;31m",
|
||||
warnLogger: "\033[1;33m",
|
||||
// 定义时间
|
||||
currentTime:'$(date "+%Y-%m-%d %H:%M:%S")'
|
||||
currentTime: '$(date "+%Y-%m-%d %H:%M:%S")'
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user