@winding-labs/zest 0.2.0 → 0.2.1
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/bin/zest.js +7 -4
- package/package.json +1 -1
package/bin/zest.js
CHANGED
|
@@ -34,7 +34,7 @@ import {
|
|
|
34
34
|
writeFileSync
|
|
35
35
|
} from "node:fs";
|
|
36
36
|
import { homedir } from "node:os";
|
|
37
|
-
import { dirname, join, resolve, sep } from "node:path";
|
|
37
|
+
import { dirname, join, resolve, sep, win32 } from "node:path";
|
|
38
38
|
import { pipeline } from "node:stream/promises";
|
|
39
39
|
import { createGunzip } from "node:zlib";
|
|
40
40
|
function getCacheBase(namespace) {
|
|
@@ -59,6 +59,9 @@ function getPlatformKey() {
|
|
|
59
59
|
function getBinaryName(prefix, platform) {
|
|
60
60
|
return platform === "win-x64" ? `${prefix}win-x64.exe` : `${prefix}${platform}`;
|
|
61
61
|
}
|
|
62
|
+
function zipTar(platform = process.platform, systemRoot = process.env.SystemRoot) {
|
|
63
|
+
return platform === "win32" ? win32.join(systemRoot ?? "C:\\Windows", "System32", "tar.exe") : "tar";
|
|
64
|
+
}
|
|
62
65
|
function extractZipToFile(zipPath, destPath) {
|
|
63
66
|
const unzip = spawnSync("unzip", ["-p", zipPath], {
|
|
64
67
|
encoding: "buffer",
|
|
@@ -68,7 +71,7 @@ function extractZipToFile(zipPath, destPath) {
|
|
|
68
71
|
writeFileSync(destPath, unzip.stdout);
|
|
69
72
|
return;
|
|
70
73
|
}
|
|
71
|
-
const tar = spawnSync(
|
|
74
|
+
const tar = spawnSync(zipTar(), ["-xOf", zipPath], {
|
|
72
75
|
encoding: "buffer",
|
|
73
76
|
maxBuffer: 256 * 1024 * 1024
|
|
74
77
|
});
|
|
@@ -195,8 +198,8 @@ var addToUserPath = (dir, first = false) => editUserPath(dir, true, first);
|
|
|
195
198
|
|
|
196
199
|
// src/bootstrap.ts
|
|
197
200
|
var REPO = "Winding-Labs/zest-cli";
|
|
198
|
-
var VERSION = "0.2.
|
|
199
|
-
var ASSETS = JSON.parse('{"darwin-arm64":{"file":"zest-darwin-arm64.gz","sha256":"
|
|
201
|
+
var VERSION = "0.2.1";
|
|
202
|
+
var ASSETS = JSON.parse('{"darwin-arm64":{"file":"zest-darwin-arm64.gz","sha256":"9aa92d108655dc41bfe41f3da421098523dd54338294dc57fdf5bc65d304f0e7"},"darwin-x64":{"file":"zest-darwin-x64.gz","sha256":"96ac36d3fe75a7d6af98fb84572f9d2c7fe0221b272896d630ddda9e7e2ced35"},"linux-arm64":{"file":"zest-linux-arm64.gz","sha256":"6042e0dbaadacc8b5eb465f44f32b8c5741500eec0d19709cfa883089902fe0e"},"linux-x64":{"file":"zest-linux-x64.gz","sha256":"9f551337633c68a283e3382d6b7384c7c4c13b0e1015a5644f4970f87c8f79a6"},"win-x64":{"file":"zest-win-x64.exe.zip","sha256":"07c0a2e10f5631b66a3422bda827307061779c40376dbe21098a38429fa4dffb"}}');
|
|
200
203
|
function linkOnPath(target) {
|
|
201
204
|
const dir = join3(homedir2(), ".local", "bin");
|
|
202
205
|
const link = join3(dir, "zest");
|