From 6789050c488dc2c41fa02f7b664df9f08dac8f7a Mon Sep 17 00:00:00 2001
From: wujingjing <gersonwu@qq.com>
Date: 星期二, 18 二月 2025 14:23:11 +0800
Subject: [PATCH] var

---
 scripts/helper.js |   29 +++++++++++++++++++++++------
 1 files changed, 23 insertions(+), 6 deletions(-)

diff --git a/scripts/helper.js b/scripts/helper.js
index 8c7f71d..f63ba78 100644
--- a/scripts/helper.js
+++ b/scripts/helper.js
@@ -17,11 +17,11 @@
 /** 鍏叡鏂囦欢澶癸紝鎵�鏈夊鎴锋枃浠跺す鍏变韩鏂囦欢 */
 const commonDir = path.join(customerListDir, 'common');
 
- const item = customerList[0];
-const customerSplit = item.split(':');
-const deployEnv = customerSplit[1];
+const item = customerList[0];
+const customerSplit = item?.split(':');
+const deployEnv = customerSplit?.[1];
 // 鏄惁涓虹敓浜х幆澧�
-const isPro = deployEnv==='pro';
+const isPro = deployEnv === 'pro';
 // const deployEnv = process.argv[3];
 
 const logColor = (text, color) => {
@@ -195,11 +195,11 @@
 
 const copyAmisEditor = () => {
 	// 澶嶅埗amis-editor 鍒� public鏂囦欢澶逛腑
-	const amisEditorPath = path.join(rootDir, 'amis-editor');
+	const amisEditorPath = path.join(rootDir, 'wi.amis', 'amis-editor');
 	const targetPath = path.join(publicDir, 'amis-editor');
 	const isExist = fs.pathExistsSync(amisEditorPath);
 	if (!isExist) {
-		logWarn('amis-editor 涓嶅瓨鍦紒');
+		logWarn(`amis-editor锛堣矾寰勶細${amisEditorPath} 涓嶅瓨鍦紒`);
 	} else {
 		const isExist = fs.pathExistsSync(targetPath);
 		if (!isExist) {
@@ -338,6 +338,21 @@
 	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,
@@ -369,4 +384,6 @@
 
 	updateImportGlob,
 	restoreImportGlob,
+	deployEnv,
+	changeBranch,
 };

--
Gitblit v1.9.3