ai-project-manage-cli 6.0.46 → 6.0.47

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/dist/index.js +14 -7
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -414,7 +414,9 @@ async function resolveRepositoryIdForSync(api, workdirPath) {
414
414
  if (gitUrl) {
415
415
  const matched = await api.cli.matchRepository({ url: gitUrl });
416
416
  if (matched.repositoryId) {
417
- console.log(`[apm] \u5DE5\u4F5C\u7A7A\u95F4\u8DEF\u5F84\u672A\u5339\u914D\uFF0C\u5DF2\u901A\u8FC7 git remote \u5173\u8054\u4ED3\u5E93: ${gitUrl}`);
417
+ console.log(
418
+ `[apm] \u5DE5\u4F5C\u7A7A\u95F4\u8DEF\u5F84\u672A\u5339\u914D\uFF0C\u5DF2\u901A\u8FC7 git remote \u5173\u8054\u4ED3\u5E93: ${gitUrl}`
419
+ );
418
420
  return { repositoryId: matched.repositoryId, diagnostic: null };
419
421
  }
420
422
  }
@@ -1122,6 +1124,13 @@ function readCliVersion() {
1122
1124
  }
1123
1125
 
1124
1126
  // src/commands/update.ts
1127
+ var useNpmShell = process.platform === "win32";
1128
+ function runNpm(args, options = {}) {
1129
+ return spawnSync(useNpmShell ? "npm.cmd" : "npm", args, {
1130
+ ...options,
1131
+ shell: useNpmShell
1132
+ });
1133
+ }
1125
1134
  function registryBaseUrl() {
1126
1135
  const fromEnv = process.env.npm_config_registry?.trim() || process.env.NPM_CONFIG_REGISTRY?.trim();
1127
1136
  return (fromEnv || "https://registry.npmjs.org").replace(/\/+$/, "");
@@ -1138,7 +1147,7 @@ async function fetchLatestPublishedVersion() {
1138
1147
  }
1139
1148
  }
1140
1149
  function npmAvailable() {
1141
- const r = spawnSync("npm", ["--version"], { encoding: "utf8" });
1150
+ const r = runNpm(["--version"], { encoding: "utf8" });
1142
1151
  return !r.error && r.status === 0;
1143
1152
  }
1144
1153
  async function runUpdate() {
@@ -1158,11 +1167,9 @@ async function runUpdate() {
1158
1167
  console.error(
1159
1168
  `[apm] \u5F53\u524D\u7248\u672C ${current}\uFF0C\u6B63\u5728\u5B89\u88C5 ${CLI_PACKAGE_NAME}@${targetLabel} \u2026`
1160
1169
  );
1161
- const install = spawnSync(
1162
- "npm",
1163
- ["install", "-g", `${CLI_PACKAGE_NAME}@latest`],
1164
- { stdio: "inherit", shell: process.platform === "win32" }
1165
- );
1170
+ const install = runNpm(["install", "-g", `${CLI_PACKAGE_NAME}@latest`], {
1171
+ stdio: "inherit"
1172
+ });
1166
1173
  if (install.error) {
1167
1174
  console.error("[apm] \u66F4\u65B0\u5931\u8D25:", install.error.message);
1168
1175
  process.exit(1);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai-project-manage-cli",
3
- "version": "6.0.46",
3
+ "version": "6.0.47",
4
4
  "description": "命令行工具:后续用于调用平台后端 API 完成运维与自动化操作",
5
5
  "type": "module",
6
6
  "private": false,