@taole/deploy-helper 0.2.3 → 0.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/index.mjs +13 -12
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -81,6 +81,7 @@ async function main() {
|
|
|
81
81
|
const workDir = process.cwd(); // 当前项目根目录
|
|
82
82
|
const mode = process.argv[2] === 'prod' ? 'prod' : 'test'; // 部署环境
|
|
83
83
|
console.log(`deploy mode: ${mode}`);
|
|
84
|
+
console.log(`workDire: ${workDir}`);
|
|
84
85
|
|
|
85
86
|
// 读取配置
|
|
86
87
|
const config = await loadConfig();
|
|
@@ -139,18 +140,18 @@ async function main() {
|
|
|
139
140
|
}
|
|
140
141
|
|
|
141
142
|
// 2.1如果是prod模式,检查当前项目是不是处于主分支
|
|
142
|
-
if (mode === 'prod') {
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
}
|
|
143
|
+
// if (mode === 'prod') {
|
|
144
|
+
// const currentGit = simpleGit(workDir);
|
|
145
|
+
// const currentStatus = await currentGit.status();
|
|
146
|
+
// if (!currentStatus.isClean()) {
|
|
147
|
+
// console.log(`当前项目有未提交内容, 请先处理`);
|
|
148
|
+
// process.exit(1);
|
|
149
|
+
// }
|
|
150
|
+
// if (currentStatus.branch !== currentProdBranch) {
|
|
151
|
+
// console.log(`当前项目分支${currentStatus.branch}不是${currentProdBranch}分支, 请切换至${currentProdBranch}分支再执行prod命令`);
|
|
152
|
+
// process.exit(1);
|
|
153
|
+
// }
|
|
154
|
+
// }
|
|
154
155
|
|
|
155
156
|
// 3. 检查assets项目分支,并切换至master分支
|
|
156
157
|
// assets项目固定使用master分支
|