@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.
Files changed (2) hide show
  1. package/index.mjs +13 -12
  2. 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
- const currentGit = simpleGit(workDir);
144
- const currentStatus = await currentGit.status();
145
- if (!currentStatus.isClean()) {
146
- console.log(`当前项目有未提交内容, 请先处理`);
147
- process.exit(1);
148
- }
149
- if (currentStatus.branch !== currentProdBranch) {
150
- console.log(`当前项目不是${currentProdBranch}分支, 请切换至${currentProdBranch}分支再执行prod命令`);
151
- process.exit(1);
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分支
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@taole/deploy-helper",
3
- "version": "0.2.3",
3
+ "version": "0.2.5",
4
4
  "description": "脚本部署工具,用于将项目部署到测试环境或生产环境",
5
5
  "main": "index.mjs",
6
6
  "type": "module",