@shadegpu/cli 0.1.12 → 0.1.14

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.
@@ -2,7 +2,12 @@
2
2
  // Shade CLI launcher — downloads binaries on first run, then execs the CLI.
3
3
 
4
4
  const { execFileSync } = require("node:child_process");
5
- const { existsSync, chmodSync, writeFileSync, readFileSync } = require("node:fs");
5
+ const {
6
+ existsSync,
7
+ chmodSync,
8
+ writeFileSync,
9
+ readFileSync,
10
+ } = require("node:fs");
6
11
  const { join } = require("node:path");
7
12
 
8
13
  const BASE_URL = "https://releases.shadegpu.com/v1/releases";
@@ -15,7 +20,9 @@ const PLATFORM_MAP = {
15
20
 
16
21
  async function download(url, dest) {
17
22
  const res = await fetch(url);
18
- if (!res.ok) throw new Error(`HTTP ${res.status} downloading ${url}`);
23
+ if (!res.ok) {
24
+ throw new Error(`HTTP ${res.status} downloading ${url}`);
25
+ }
19
26
  writeFileSync(dest, Buffer.from(await res.arrayBuffer()));
20
27
  chmodSync(dest, 0o755);
21
28
  }
@@ -30,7 +37,9 @@ async function main() {
30
37
  process.exit(1);
31
38
  }
32
39
 
33
- const pkg = JSON.parse(readFileSync(join(BIN_DIR, "..", "package.json"), "utf-8"));
40
+ const pkg = JSON.parse(
41
+ readFileSync(join(BIN_DIR, "..", "package.json"), "utf-8"),
42
+ );
34
43
  const version = pkg.version;
35
44
 
36
45
  const files = [
@@ -41,7 +50,9 @@ async function main() {
41
50
 
42
51
  const missing = files.filter((f) => !existsSync(join(BIN_DIR, f.name)));
43
52
  if (missing.length > 0) {
44
- console.error(`@shadegpu/cli: downloading ${missing.map((f) => f.name).join(", ")}...`);
53
+ console.error(
54
+ `@shadegpu/cli: downloading ${missing.map((f) => f.name).join(", ")}...`,
55
+ );
45
56
  for (const f of missing) {
46
57
  await download(`${BASE_URL}/${f.path}`, join(BIN_DIR, f.name));
47
58
  }
@@ -50,7 +61,9 @@ async function main() {
50
61
  try {
51
62
  execFileSync(nativeBin, process.argv.slice(2), { stdio: "inherit" });
52
63
  } catch (e) {
53
- if (e && e.status !== undefined) process.exit(e.status);
64
+ if (e && e.status !== undefined) {
65
+ process.exit(e.status);
66
+ }
54
67
  throw e;
55
68
  }
56
69
  }
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@shadegpu/cli",
3
- "version": "0.1.12",
3
+ "version": "0.1.14",
4
4
  "description": "Encrypted GPU inference on untrusted infrastructure",
5
5
  "bin": {
6
- "shade": "bin/shade"
6
+ "shade": "bin/shade.js"
7
7
  },
8
8
  "files": [
9
- "bin/shade"
9
+ "bin/shade.js"
10
10
  ],
11
11
  "keywords": [
12
12
  "gpu",