@ziniao-open/cli 1.0.5 → 1.0.7

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/package.json +1 -1
  2. package/scripts/install.js +17 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ziniao-open/cli",
3
- "version": "1.0.5",
3
+ "version": "1.0.7",
4
4
  "description": "紫鸟开放平台命令行工具,为开发者和 AI Agent 提供统一的接口调用入口。",
5
5
  "license": "UNLICENSED",
6
6
  "bin": {
@@ -153,11 +153,25 @@ function parseChecksums(text) {
153
153
  }
154
154
 
155
155
  function extract(archivePath, destDir) {
156
+ if (process.platform === "win32" && archivePath.endsWith(".zip")) {
157
+ const ps = spawnSync("powershell.exe", [
158
+ "-NoProfile", "-NonInteractive", "-Command",
159
+ `Expand-Archive -LiteralPath '${archivePath}' -DestinationPath '${destDir}' -Force`
160
+ ], { stdio: "inherit" });
161
+ if (!ps.error && ps.status === 0) return;
162
+ }
156
163
  let tarCmd = "tar";
157
164
  if (process.platform === "win32") {
158
- const systemTar = join(process.env.SystemRoot || "C:\\Windows", "System32", "tar.exe");
159
- if (existsSync(systemTar)) {
160
- tarCmd = systemTar;
165
+ const sysRoot = process.env.SystemRoot || "C:\\Windows";
166
+ const candidates = [
167
+ join(sysRoot, "Sysnative", "tar.exe"),
168
+ join(sysRoot, "System32", "tar.exe"),
169
+ ];
170
+ for (const p of candidates) {
171
+ if (existsSync(p)) {
172
+ tarCmd = p;
173
+ break;
174
+ }
161
175
  }
162
176
  }
163
177
  const res = spawnSync(tarCmd, ["-xf", archivePath, "-C", destDir], { stdio: "inherit" });