wujingjing
2024-09-23 a49415177a0a812a7dcd00ae4cc56e48f6bfb5da
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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,...]”,
    部署到生产环境写法:customer:pro
    `);
    exit(); // 退出脚本
}
const myEnv = deployEnv==='pro'?'prod':'dev'
changeBranch();
 
checkCustomer('npm run deploy');
 
// uploadFiles();
try {
    execSync(`npx deploy ${myEnv}`, { stdio: 'inherit' });
} catch (error) {}