prized 0.21.5 → 0.21.6-rc.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/lib/install.js CHANGED
@@ -8,7 +8,7 @@ import { existsSync } from 'node:fs';
8
8
  import { mkdir, rename, rm, writeFile } from 'node:fs/promises';
9
9
  import { join } from 'node:path';
10
10
  import { verifyMinisign } from './minisign.js';
11
- import { assetFor, binaryName, cacheRoot, RELEASE_PUBKEY, RELEASES_BASE } from './release.js';
11
+ import { assetFor, binaryName, cacheRoot, RELEASE_PUBKEY, RELEASES_BASE, tarFor } from './release.js';
12
12
 
13
13
  const VERIFIED = '.verified';
14
14
 
@@ -55,7 +55,7 @@ export async function ensureCli(version, opts = {}) {
55
55
  try {
56
56
  const file = join(tmp, asset);
57
57
  await writeFile(file, archive, { mode: 0o600 });
58
- const tar = spawnSync('tar', [asset.endsWith('.zip') ? '-xf' : '-xzf', file, '-C', tmp], { stdio: 'pipe' });
58
+ const tar = spawnSync(tarFor(platform), [asset.endsWith('.zip') ? '-xf' : '-xzf', file, '-C', tmp], { stdio: 'pipe' });
59
59
  if (tar.status !== 0) {
60
60
  throw new Error(`could not unpack ${asset}: ${(tar.stderr ?? '').toString().trim() || tar.error?.message || 'tar failed'}`);
61
61
  }
package/lib/release.js CHANGED
@@ -1,7 +1,7 @@
1
1
  // Where the signed Prized CLI lives and how to name this machine's build
2
2
  // (the release workflow's archive names, docs/plans/npx-signup.md §5).
3
3
  import { homedir } from 'node:os';
4
- import { join } from 'node:path';
4
+ import { join, win32 } from 'node:path';
5
5
 
6
6
  export const RELEASES_BASE = 'https://doppel-releases-072456928225-usw2.s3.us-west-2.amazonaws.com';
7
7
 
@@ -24,6 +24,17 @@ export function binaryName(platform = process.platform) {
24
24
  return platform === 'win32' ? 'prized.exe' : 'prized';
25
25
  }
26
26
 
27
+ /**
28
+ * The tar that unpacks this platform's archive. On Windows the archive is a
29
+ * zip, which Windows' own tar (bsdtar, in System32 since Windows 10 1803)
30
+ * reads and GNU tar refuses ("This does not look like a tar archive"). In
31
+ * Git Bash the first tar on PATH is Git's GNU one, so it is named by path.
32
+ */
33
+ export function tarFor(platform = process.platform, env = process.env) {
34
+ if (platform !== 'win32') return 'tar';
35
+ return win32.join(env.SystemRoot || env.windir || 'C:\\Windows', 'System32', 'tar.exe');
36
+ }
37
+
27
38
  /** The per-version cache the verified CLI is kept in. */
28
39
  export function cacheRoot(env = process.env, platform = process.platform, home = homedir()) {
29
40
  if (platform === 'win32') return join(env.LOCALAPPDATA || join(home, 'AppData', 'Local'), 'Prized', 'npm');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "prized",
3
- "version": "0.21.5",
3
+ "version": "0.21.6-rc.1",
4
4
  "description": "Prized: a cloud dev box for your coding agents. npx prized signs you up, starts your box and sets up this machine.",
5
5
  "homepage": "https://prized.dev",
6
6
  "license": "UNLICENSED",