@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.
Files changed (2) hide show
  1. package/bin/zest.js +7 -4
  2. 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("tar", ["-xOf", zipPath], {
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.0";
199
- var ASSETS = JSON.parse('{"darwin-arm64":{"file":"zest-darwin-arm64.gz","sha256":"297c5aa5381658c4e1b8f4e575efe5843239a67fac25d5eed738b00ba977b2c1"},"darwin-x64":{"file":"zest-darwin-x64.gz","sha256":"4fcddd9336866be0b7ecdb6068650efb81d09324e909ee1e436de3f3821e89a3"},"linux-arm64":{"file":"zest-linux-arm64.gz","sha256":"9f79e07724ab87ae13577a1505ca83f9e15d9e3a7b12116bce4f17f3e46e53e7"},"linux-x64":{"file":"zest-linux-x64.gz","sha256":"d6682c1fd7fc74898a4b4ba8d2f657368a7bf2dc2060b647f882c29013f8dee8"},"win-x64":{"file":"zest-win-x64.exe.zip","sha256":"245e1ec5572cc7dc9380e0b9aa4cd02e29af34955da5baf5d89f1b9a7c73968d"}}');
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");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@winding-labs/zest",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "Measure your AI coding sessions with Zest",
5
5
  "type": "module",
6
6
  "bin": {