| | |
| | | /** 公共文件夹,所有客户文件夹共享文件 */ |
| | | const commonDir = path.join(customerListDir, 'common'); |
| | | |
| | | const item = customerList[0]; |
| | | const customerSplit = item.split(':'); |
| | | const deployEnv = customerSplit[1]; |
| | | const item = customerList[0]; |
| | | const customerSplit = item?.split(':'); |
| | | const deployEnv = customerSplit?.[1]; |
| | | // 是否为生产环境 |
| | | const isPro = deployEnv==='pro'; |
| | | const isPro = deployEnv === 'pro'; |
| | | // const deployEnv = process.argv[3]; |
| | | |
| | | const logColor = (text, color) => { |
| | |
| | | |
| | | const copyAmisEditor = () => { |
| | | // 复制amis-editor 到 public文件夹中 |
| | | const amisEditorPath = path.join(rootDir, 'amis-editor'); |
| | | const amisEditorPath = path.join(rootDir, 'wi.amis', 'amis-editor'); |
| | | const targetPath = path.join(publicDir, 'amis-editor'); |
| | | const isExist = fs.pathExistsSync(amisEditorPath); |
| | | if (!isExist) { |
| | | logWarn('amis-editor 不存在!'); |
| | | logWarn(`amis-editor(路径:${amisEditorPath} 不存在!`); |
| | | } else { |
| | | const isExist = fs.pathExistsSync(targetPath); |
| | | if (!isExist) { |
| | |
| | | /** |
| | | * 切换分支 |
| | | */ |
| | | const changeBranch = () =>{ |
| | | const changeBranch = () => { |
| | | if (isPro) { |
| | | try { |
| | | execSync('git checkout master', { stdio: 'inherit' }); |
| | |
| | | execSync('git checkout test', { stdio: 'inherit' }); |
| | | } catch (error) {} |
| | | } |
| | | } |
| | | }; |
| | | |
| | | module.exports = { |
| | | isPro, |
| | |
| | | updateImportGlob, |
| | | restoreImportGlob, |
| | | deployEnv, |
| | | changeBranch |
| | | changeBranch, |
| | | }; |