@gmcb/cli 0.8.7 → 0.8.9

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/CHANGELOG.md CHANGED
@@ -3,6 +3,22 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [0.8.9](http://10.10.10.16/caoben/front-end/compare/@gmcb/cli@0.8.8...@gmcb/cli@0.8.9) (2026-07-16)
7
+
8
+ **Note:** Version bump only for package @gmcb/cli
9
+
10
+
11
+
12
+
13
+
14
+ ## [0.8.8](http://10.10.10.16/caoben/front-end/compare/@gmcb/cli@0.8.7...@gmcb/cli@0.8.8) (2026-07-16)
15
+
16
+ **Note:** Version bump only for package @gmcb/cli
17
+
18
+
19
+
20
+
21
+
6
22
  ## [0.8.7](http://10.10.10.16/caoben/front-end/compare/@gmcb/cli@0.8.6...@gmcb/cli@0.8.7) (2026-07-15)
7
23
 
8
24
  **Note:** Version bump only for package @gmcb/cli
@@ -337,6 +337,8 @@ async function fetchRemoteResources(opts) {
337
337
  try {
338
338
  // 已有目录:fetch 目标分支 + 校验远程分支 + 切换 + pull
339
339
  const repoGit = (0, simple_git_1.default)(repoDir);
340
+ // 0. 撤销上次构建残留的本地修改,防止拉取冲突
341
+ await repoGit.reset(['--hard']);
340
342
  // 1. 拉取目标分支(显式指定,不受 --single-branch refspec 限制)
341
343
  // --prune 确保远程已删除的分支不会残留在本地引用中
342
344
  await repoGit.fetch('origin', `+refs/heads/${branch}:refs/remotes/origin/${branch}`, ['--prune']);
package/lib/apis/index.js CHANGED
@@ -214,12 +214,16 @@ async function fetchLatestVersion(params) {
214
214
  pageNo: 1,
215
215
  pageSize: 1,
216
216
  });
217
- const versionList = (versionPage?.list || []).filter((item) => item.status < 2);
218
- const latestVersion = versionList[0];
217
+ const versionList = versionPage?.list || [];
218
+ const { versionName = '', versionNum = 0, updateMode = 0, status } = versionList[0] || {};
219
+ let versionCode = Number(versionNum || 0);
220
+ if (status == 2 && versionCode) {
221
+ versionCode += 1;
222
+ }
219
223
  return {
220
- versionName: latestVersion?.versionName ?? '',
221
- versionCode: Number(latestVersion?.versionNum ?? 0),
222
- updateMode: latestVersion?.updateMode ?? 0,
224
+ versionName,
225
+ versionCode,
226
+ updateMode,
223
227
  };
224
228
  }
225
229
  catch (err) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gmcb/cli",
3
- "version": "0.8.7",
3
+ "version": "0.8.9",
4
4
  "description": "工茂草本前端命令行工具",
5
5
  "author": "yinjiazeng@163.com",
6
6
  "license": "MIT",
@@ -59,5 +59,5 @@
59
59
  "@types/rimraf": "^4.0.5",
60
60
  "@types/user-home": "^2.0.2"
61
61
  },
62
- "gitHead": "aeb596902d44e2c67224cf96aa30fd6a91f92572"
62
+ "gitHead": "bbab898cd0854797c1dc2e52d3821b99a15890ac"
63
63
  }