| | |
| | | const commonDir = path.join(customerListDir, 'common'); |
| | | |
| | | const item = customerList[0]; |
| | | const customerSplit = item.split(':'); |
| | | const deployEnv = customerSplit[1]; |
| | | const customerSplit = item?.split(':'); |
| | | const deployEnv = customerSplit?.[1]; |
| | | // 是否为生产环境 |
| | | const isPro = deployEnv==='pro'; |
| | | // const deployEnv = process.argv[3]; |
| | |
| | | logSuccess(`${formatDate(new Date(), 'HH:MM:SS')} > 🎉🎉🎉【${customerList.join(',')}】项目已成功部署!🎉🎉🎉`); |
| | | }; |
| | | |
| | | /** |
| | | * 切换分支 |
| | | */ |
| | | const changeBranch = () =>{ |
| | | if (isPro) { |
| | | try { |
| | | execSync('git checkout master', { stdio: 'inherit' }); |
| | | } catch (error) {} |
| | | } else { |
| | | try { |
| | | execSync('git checkout test', { stdio: 'inherit' }); |
| | | } catch (error) {} |
| | | } |
| | | } |
| | | |
| | | module.exports = { |
| | | isPro, |
| | | firstCustomerName, |
| | |
| | | |
| | | updateImportGlob, |
| | | restoreImportGlob, |
| | | deployEnv, |
| | | changeBranch |
| | | }; |