@ziniao-open/cli 0.1.0-beta.30 → 0.1.0-beta.31

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ziniao-open/cli",
3
- "version": "0.1.0-beta.30",
3
+ "version": "0.1.0-beta.31",
4
4
  "description": "紫鸟开放平台命令行工具,为开发者和 AI Agent 提供统一的接口调用入口。",
5
5
  "license": "UNLICENSED",
6
6
  "bin": {
@@ -153,7 +153,14 @@ function parseChecksums(text) {
153
153
  }
154
154
 
155
155
  function extract(archivePath, destDir) {
156
- const res = spawnSync("tar", ["-xf", archivePath, "-C", destDir], { stdio: "inherit" });
156
+ let tarCmd = "tar";
157
+ if (process.platform === "win32") {
158
+ const systemTar = join(process.env.SystemRoot || "C:\\Windows", "System32", "tar.exe");
159
+ if (existsSync(systemTar)) {
160
+ tarCmd = systemTar;
161
+ }
162
+ }
163
+ const res = spawnSync(tarCmd, ["-xf", archivePath, "-C", destDir], { stdio: "inherit" });
157
164
  if (res.error) {
158
165
  fail(`failed to execute tar: ${res.error.message}. Tar is required (preinstalled on Win10+/macOS/Linux).`);
159
166
  }