@ziniao-open/cli 0.1.0-beta.29 → 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 +1 -1
- package/scripts/install.js +8 -1
package/package.json
CHANGED
package/scripts/install.js
CHANGED
|
@@ -153,7 +153,14 @@ function parseChecksums(text) {
|
|
|
153
153
|
}
|
|
154
154
|
|
|
155
155
|
function extract(archivePath, destDir) {
|
|
156
|
-
|
|
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
|
}
|