wujingjing
2024-09-09 1931d76359a458b7d31b8bfb955d07882672d4bb
scripts/publish.js
@@ -1,6 +1,6 @@
const { execSync } = require('child_process');
const { customerList, checkCustomerDirExist, logError,exit,firstCustomerName,changeBranch } = require('./helper');
const { customerList, checkCustomerDirExist, logError,exit,firstCustomerName,changeBranch,deployEnv } = require('./helper');
// if (!customerList || customerList.length === 0) {
//    logError(`请正确使用命令 “npm run publish [customer1,customer2,customer3,...]”,
//    部署到生产环境写法:customer:pro
@@ -25,9 +25,9 @@
try {
   // 随便拿第一个用于 build
   execSync(`npm run build ${firstCustomerName}`, { stdio: 'inherit' });
   execSync(`npm run build ${firstCustomerName}:${deployEnv}`, { stdio: 'inherit' });
} catch (error) {}
try {
   execSync(`npm run deploy "${customerList.join(' ')}"`, { stdio: 'inherit' });
   execSync(`npm run deploy ${firstCustomerName}:${deployEnv}`, { stdio: 'inherit' });
} catch (error) {}