wujingjing
2024-12-12 a3c84d896dff3758f3bc3274b0306afe018179a8
scripts/deploy.js
@@ -1,4 +1,5 @@
const { uploadFiles, customerList, checkCustomer, changeBranch } = require('./helper');
const { uploadFiles, customerList, checkCustomer, changeBranch,deployEnv } = require('./helper');
const { execSync } = require('child_process');
if (!customerList || customerList.length === 0) {
   logError(`请正确使用命令 “npm run deploy [customer1,customer2,customer3,...]”,
@@ -6,8 +7,14 @@
   `);
   exit(); // 退出脚本
}
const myEnv = deployEnv==='pro'?'prod':'dev'
changeBranch();
checkCustomer('npm run deploy');
uploadFiles();
// uploadFiles();
try {
   execSync(`npx deploy ${myEnv}`, { stdio: 'inherit' });
} catch (error) {}