From 2af68406788a95115dd8312c9cd20e70104cd573 Mon Sep 17 00:00:00 2001
From: wujingjing <gersonwu@qq.com>
Date: 星期日, 03 十一月 2024 18:09:22 +0800
Subject: [PATCH] 添加、删除计数bug

---
 scripts/helper.js |   21 +++++++++++++++++++--
 1 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/scripts/helper.js b/scripts/helper.js
index 8c7f71d..281ab87 100644
--- a/scripts/helper.js
+++ b/scripts/helper.js
@@ -18,8 +18,8 @@
 const commonDir = path.join(customerListDir, 'common');
 
  const item = customerList[0];
-const customerSplit = item.split(':');
-const deployEnv = customerSplit[1];
+const customerSplit = item?.split(':');
+const deployEnv = customerSplit?.[1];
 // 鏄惁涓虹敓浜х幆澧�
 const isPro = deployEnv==='pro';
 // const deployEnv = process.argv[3];
@@ -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