ai-project-manage-cli 8.0.9 → 8.0.10

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.
@@ -983,24 +983,18 @@ async function checkoutBaselineBranch(baselineBranch, options = {}) {
983
983
  const gitRoot = await resolveGitRepoRoot(cwd);
984
984
  await ensureGitRepo(gitRoot);
985
985
  if (await isWorkingTreeDirty(gitRoot)) {
986
- throw new Error(
987
- `[apm] \u5DE5\u4F5C\u533A\u6709\u672A\u63D0\u4EA4\u53D8\u66F4\uFF0C\u65E0\u6CD5\u5207\u6362\u5230\u57FA\u7EBF\u5206\u652F ${baseline}`
988
- );
986
+ throw new Error(`[apm] \u5DE5\u4F5C\u533A\u6709\u672A\u63D0\u4EA4\u53D8\u66F4\uFF0C\u65E0\u6CD5\u5207\u6362\u5230\u57FA\u7EBF\u5206\u652F ${baseline}`);
989
987
  }
990
988
  await ensureRemoteBaselineBranch(gitRoot, baseline);
991
989
  const current = await getCurrentBranch(gitRoot);
992
- if (current === baseline) {
993
- await execGit(gitRoot, ["reset", "--hard", `origin/${baseline}`]);
994
- console.log(`[apm] \u5DF2\u5728\u57FA\u7EBF ${baseline}\uFF0C\u5DF2\u5BF9\u9F50 origin/${baseline}`);
995
- return baseline;
996
- }
997
- await execGit(gitRoot, [
998
- "checkout",
999
- "-B",
1000
- baseline,
1001
- `origin/${baseline}`
1002
- ]);
1003
- console.log(`[apm] \u5DF2\u5207\u6362\u5230\u57FA\u7EBF\u5206\u652F ${baseline}`);
990
+ if (current !== baseline) {
991
+ await execGit(gitRoot, ["checkout", "-B", baseline, `origin/${baseline}`]);
992
+ }
993
+ await execGit(gitRoot, ["reset", "--hard", `origin/${baseline}`]);
994
+ const head = (await execGit(gitRoot, ["rev-parse", "--short", "HEAD"], true)).trim();
995
+ console.log(
996
+ `[apm] \u5DF2\u5207\u6362\u5230\u57FA\u7EBF ${baseline}\uFF0C\u5E76\u5BF9\u9F50 origin/${baseline}\uFF08${head}\uFF09`
997
+ );
1004
998
  return baseline;
1005
999
  }
1006
1000
 
@@ -4103,7 +4097,7 @@ async function handleWebIdePackage(cfg, msg, signal) {
4103
4097
  );
4104
4098
  if (signal.aborted) throw new Error("\u4EFB\u52A1\u5DF2\u53D6\u6D88");
4105
4099
  await runPrepStep(
4106
- "\u5207\u6362\u57FA\u7EBF\u5206\u652F",
4100
+ "\u5207\u6362\u57FA\u7EBF\u5E76\u62C9\u53D6\u6700\u65B0",
4107
4101
  async () => checkoutBaselineBranches(msg.baseBranch, { cwd: workdir }),
4108
4102
  (result) => `baseline=${result.baseline} kind=${result.kind} repos=${result.repos.length}`
4109
4103
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai-project-manage-cli",
3
- "version": "8.0.9",
3
+ "version": "8.0.10",
4
4
  "description": "命令行工具:后续用于调用平台后端 API 完成运维与自动化操作",
5
5
  "type": "module",
6
6
  "private": false,