fe-build-cli 1.2.4 → 1.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/cli.js +9 -6
package/package.json
CHANGED
package/src/cli.js
CHANGED
|
@@ -268,20 +268,23 @@ async function deployCommand(config) {
|
|
|
268
268
|
}
|
|
269
269
|
}
|
|
270
270
|
|
|
271
|
-
//
|
|
272
|
-
|
|
271
|
+
// 确定发布模式
|
|
272
|
+
// 优先级:命令行参数 > 配置文件 deployMode > 自动识别
|
|
273
|
+
let deployMode = 'main'; // 默认值
|
|
273
274
|
|
|
274
|
-
// 命令行参数优先
|
|
275
|
+
// 1. 命令行参数优先
|
|
275
276
|
if (useTestBranch) {
|
|
276
277
|
deployMode = 'test';
|
|
277
278
|
} else if (useCurrentBranch) {
|
|
278
279
|
deployMode = 'current';
|
|
279
280
|
} else if (useMainBranch) {
|
|
280
281
|
deployMode = 'main';
|
|
282
|
+
} else if (config.deployMode) {
|
|
283
|
+
// 2. 使用配置文件的 deployMode
|
|
284
|
+
deployMode = config.deployMode;
|
|
285
|
+
console.log(`\n📌 使用配置文件发布模式: ${deployMode}`);
|
|
281
286
|
} else {
|
|
282
|
-
//
|
|
283
|
-
// test 环境 → test 发布模式
|
|
284
|
-
// production 环境 → main 发布模式
|
|
287
|
+
// 3. 自动根据部署环境选择发布模式(仅当配置文件未设置时)
|
|
285
288
|
const targetEnv = selectedServers[0];
|
|
286
289
|
if (targetEnv === 'test') {
|
|
287
290
|
deployMode = 'test';
|