@zainriazdev/zpatch 0.6.3 → 0.6.5
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/README.md +7 -3
- package/build/zpatch.js +169 -28
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -13,19 +13,23 @@ zpatch login
|
|
|
13
13
|
zpatch --version
|
|
14
14
|
```
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
Running `zpatch` starts setup on first use and opens the native CLI after installation. The launcher opens your default browser for sign-in and also prints the link. Approve access there, then return to the same terminal to see sign-in, download, and verification progress. Use `zpatch login --no-browser` to open the link yourself. The browser must be able to reach the launcher’s loopback listener on the same computer. You can [verify your email in zpatch](https://zpatch-auth.zainriaz.dev/account/email).
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
The launcher checks your system and install location, downloads the matching native bundle, and verifies its size and SHA-256 before installation.
|
|
19
19
|
|
|
20
20
|
## Everyday commands
|
|
21
21
|
|
|
22
22
|
| Command | What it does |
|
|
23
23
|
| --- | --- |
|
|
24
|
-
| `zpatch doctor` |
|
|
24
|
+
| `zpatch doctor` | Reports the OS, Node.js and hardware architecture, available CPU threads, RAM, Linux libc, disk headroom, and installation integrity. `missing` is expected before the first login. |
|
|
25
25
|
| `zpatch login` | Signs in through the browser and installs the current native release. |
|
|
26
26
|
| `zpatch update` | Downloads and verifies the current native release. It reuses a valid sign-in when available. |
|
|
27
27
|
| `zpatch --version` | Prints the installed native version, which can differ from the npm launcher version. |
|
|
28
28
|
| `zpatch --help` | Shows the installed CLI's commands and options. |
|
|
29
|
+
| `zpatch config get default-target --json` | Shows the effective archive member and its source. Works offline before login. |
|
|
30
|
+
| `zpatch config set default-target NAME` | Saves the local default. `zpatch config reset default-target` clears it. |
|
|
31
|
+
|
|
32
|
+
Use `zpatch run --file sample.zip --replace replacement.txt --dry-run --json` for a single archive. The target comes from `--target`, `ZPATCH_DEFAULT_TARGET`, local config, or `123.txt`, in that order.
|
|
29
33
|
|
|
30
34
|
The launcher stores the native release under `~/.zpatch/bin/` by default and checks the installed binary's SHA-256 before running it. The npm package has no install-time scripts, runtime dependencies, native binaries, or credentials. GitHub Actions publishes the launcher through npm Trusted Publishing with provenance. [Launcher source](https://github.com/zainriaz-dev/zpatch-cli)
|
|
31
35
|
|
package/build/zpatch.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createHash, randomBytes } from "node:crypto";
|
|
3
3
|
import { createReadStream, createWriteStream } from "node:fs";
|
|
4
|
-
import { lstat, mkdir, mkdtemp, readFile, rename, rm, statfs, writeFile, realpath } from "node:fs/promises";
|
|
4
|
+
import { access, lstat, mkdir, mkdtemp, open, readFile, rename, rm, statfs, writeFile, realpath } from "node:fs/promises";
|
|
5
5
|
import { createServer } from "node:http";
|
|
6
|
-
import { homedir } from "node:os";
|
|
6
|
+
import { availableParallelism, homedir, machine, release, totalmem } from "node:os";
|
|
7
|
+
import { constants } from "node:fs";
|
|
7
8
|
import { dirname, join, resolve } from "node:path";
|
|
8
9
|
import { Writable, Readable, Transform } from "node:stream";
|
|
9
10
|
import { pipeline } from "node:stream/promises";
|
|
@@ -16,7 +17,7 @@ const bin = join(base, "bin");
|
|
|
16
17
|
const credentials = join(base, "credentials.json");
|
|
17
18
|
const sha256 = /^[0-9a-f]{64}$/;
|
|
18
19
|
const versionPattern = /^[a-zA-Z0-9][\w.-]{0,63}$/;
|
|
19
|
-
const secureNames = /^(?:BREVO_API_KEY|GOOGLE_APPLICATION_CREDENTIALS|GOOGLE_API_KEY|CLOUDFLARE_API_TOKEN|APPWRITE_API_KEY|ZPATCH_LICENSE|ZPATCH_SIGNING_KEY|ZPATCH_BRIDGE_SECRET|ZPATCH_GCS_.*)$/;
|
|
20
|
+
const secureNames = /^(?:BREVO_API_KEY|GOOGLE_APPLICATION_CREDENTIALS|GOOGLE_API_KEY|CLOUDFLARE_API_TOKEN|APPWRITE_API_KEY|ZPATCH_LICENSE|ZPATCH_TOKEN|ZPATCH_SIGNING_KEY|ZPATCH_BRIDGE_SECRET|ZPATCH_GCS_.*)$/;
|
|
20
21
|
const gatewayDefault = "https://usnode.zainriaz.dev";
|
|
21
22
|
export function detectDevice(os, arch, glibc, objects = "") {
|
|
22
23
|
const platform = os + "-" + arch;
|
|
@@ -103,7 +104,32 @@ async function privateInput(label) {
|
|
|
103
104
|
process.stderr.write("\n");
|
|
104
105
|
}
|
|
105
106
|
}
|
|
106
|
-
export
|
|
107
|
+
export function browserCommand(platform, url, env) {
|
|
108
|
+
if (env.SSH_CONNECTION || env.SSH_TTY || env.SSH_CLIENT)
|
|
109
|
+
return null;
|
|
110
|
+
if (platform === "win32")
|
|
111
|
+
return ["rundll32.exe", "url.dll,FileProtocolHandler", url];
|
|
112
|
+
if (platform === "darwin")
|
|
113
|
+
return ["open", url];
|
|
114
|
+
if (env.WSL_DISTRO_NAME)
|
|
115
|
+
return ["rundll32.exe", "url.dll,FileProtocolHandler", url];
|
|
116
|
+
if (env.DISPLAY || env.WAYLAND_DISPLAY)
|
|
117
|
+
return ["xdg-open", url];
|
|
118
|
+
return null;
|
|
119
|
+
}
|
|
120
|
+
function openBrowser(url) {
|
|
121
|
+
const command = browserCommand(process.platform, url.href, process.env);
|
|
122
|
+
if (!command)
|
|
123
|
+
return Promise.resolve(false);
|
|
124
|
+
const [program, ...args] = command;
|
|
125
|
+
return new Promise(resolve => {
|
|
126
|
+
const child = spawn(program, args, { stdio: "ignore", windowsHide: true });
|
|
127
|
+
child.once("error", () => resolve(false));
|
|
128
|
+
child.once("spawn", () => resolve(true));
|
|
129
|
+
child.unref();
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
export async function oauth(server, launchBrowser = openBrowser) {
|
|
107
133
|
const resource = new URL("/mcp", server).href;
|
|
108
134
|
const prm = await jsonRequest(new URL("/.well-known/oauth-protected-resource/mcp", server));
|
|
109
135
|
if (prm.resource !== resource || typeof prm.authorization_servers?.[0] !== "string")
|
|
@@ -127,22 +153,32 @@ export async function oauth(server) {
|
|
|
127
153
|
const challenge = createHash("sha256").update(verifier).digest("base64url");
|
|
128
154
|
let receive;
|
|
129
155
|
let decline;
|
|
156
|
+
let accepted = false;
|
|
130
157
|
const callback = createServer((request, response) => {
|
|
131
|
-
const url = new URL(
|
|
132
|
-
const valid = request.method === "GET" && request.headers.host === callbackHost &&
|
|
133
|
-
url.pathname === "/callback" && url.searchParams.
|
|
134
|
-
|
|
158
|
+
const url = new URL("http://127.0.0.1/" + (request.url ?? "").replace(/^\/+/, ""));
|
|
159
|
+
const valid = request.method === "GET" && request.headers.host === callbackHost && !accepted && receive &&
|
|
160
|
+
url.pathname === "/callback" && url.searchParams.getAll("state").length === 1 &&
|
|
161
|
+
url.searchParams.get("state") === state && url.searchParams.getAll("iss").length === 1 &&
|
|
162
|
+
url.searchParams.get("iss") === issuer.origin;
|
|
163
|
+
const codes = url.searchParams.getAll("code");
|
|
135
164
|
response.setHeader("Connection", "close");
|
|
165
|
+
response.setHeader("Cache-Control", "no-store");
|
|
166
|
+
response.setHeader("Content-Type", "text/plain; charset=utf-8");
|
|
136
167
|
if (!valid) {
|
|
137
168
|
response.writeHead(400).end("Invalid callback.");
|
|
138
169
|
}
|
|
139
|
-
else if (!
|
|
170
|
+
else if (!codes.length && url.searchParams.has("error")) {
|
|
171
|
+
accepted = true;
|
|
140
172
|
response.writeHead(400).end("Sign-in was not completed. Return to the terminal.");
|
|
141
173
|
decline?.(Error("sign-in denied"));
|
|
142
174
|
}
|
|
175
|
+
else if (codes.length !== 1 || !codes[0] || url.searchParams.has("error")) {
|
|
176
|
+
response.writeHead(400).end("Invalid callback.");
|
|
177
|
+
}
|
|
143
178
|
else {
|
|
144
|
-
|
|
145
|
-
|
|
179
|
+
accepted = true;
|
|
180
|
+
response.writeHead(200).end("Approval received. Return to your terminal to see download and verification progress.");
|
|
181
|
+
receive?.(codes[0]);
|
|
146
182
|
}
|
|
147
183
|
});
|
|
148
184
|
let callbackHost = "";
|
|
@@ -168,11 +204,18 @@ export async function oauth(server) {
|
|
|
168
204
|
response_type: "code", scope: "zpatch:read", code_challenge: challenge, code_challenge_method: "S256",
|
|
169
205
|
}).toString();
|
|
170
206
|
const code = await new Promise((accept, reject) => {
|
|
171
|
-
const timer = setTimeout(() => reject(Error("
|
|
207
|
+
const timer = setTimeout(() => reject(Error("Browser approval did not reach this terminal. Open the link on the same machine and network namespace, then retry `zpatch login`.")), 180_000);
|
|
172
208
|
receive = value => { clearTimeout(timer); accept(value); };
|
|
173
209
|
decline = error => { clearTimeout(timer); reject(error); };
|
|
174
|
-
|
|
210
|
+
if (launchBrowser) {
|
|
211
|
+
void launchBrowser(authorize).catch(() => false).then(opened => {
|
|
212
|
+
if (!accepted)
|
|
213
|
+
console.error(opened ? "Opened your default browser. Waiting for approval." : "Open the link on this machine to approve. Waiting for approval.");
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
console.error("Sign-in link for this terminal:\n" + authorize.href);
|
|
175
217
|
});
|
|
218
|
+
console.error("Browser approval received. Completing sign-in…");
|
|
176
219
|
const session = await jsonRequest(oauthEndpoint(metadata.token_endpoint), {
|
|
177
220
|
method: "POST", body: new URLSearchParams({
|
|
178
221
|
grant_type: "authorization_code", client_id: registration.client_id, code,
|
|
@@ -184,17 +227,17 @@ export async function oauth(server) {
|
|
|
184
227
|
return { token: session.access_token, expires: Math.floor(Date.now() / 1000) + session.expires_in };
|
|
185
228
|
}
|
|
186
229
|
finally {
|
|
187
|
-
callback.closeAllConnections();
|
|
188
230
|
callback.close();
|
|
231
|
+
callback.closeIdleConnections();
|
|
189
232
|
}
|
|
190
233
|
}
|
|
191
|
-
async function authenticate(server, saved) {
|
|
234
|
+
async function authenticate(server, saved, noBrowser = false) {
|
|
192
235
|
if (process.env.ZPATCH_TOKEN)
|
|
193
236
|
return { token: process.env.ZPATCH_TOKEN, expires: 0 };
|
|
194
237
|
if (saved?.gateway === server.origin && saved.expires > Date.now() / 1000 + 10)
|
|
195
238
|
return { token: saved.token, expires: saved.expires };
|
|
196
239
|
if (!loopback(server) && !process.env.ZPATCH_LICENSE)
|
|
197
|
-
return oauth(server);
|
|
240
|
+
return oauth(server, noBrowser ? false : openBrowser);
|
|
198
241
|
const license = process.env.ZPATCH_LICENSE || await privateInput("License: ");
|
|
199
242
|
const session = await jsonRequest(new URL("/auth/login", server), post({ license }));
|
|
200
243
|
if (typeof session.token !== "string" || !Number.isFinite(session.expires))
|
|
@@ -316,13 +359,31 @@ async function extractBundle(path, destination, limit) {
|
|
|
316
359
|
archive.destroy();
|
|
317
360
|
}
|
|
318
361
|
}
|
|
319
|
-
async function
|
|
362
|
+
async function installDirectory() {
|
|
363
|
+
let current = base;
|
|
364
|
+
for (;;) {
|
|
365
|
+
try {
|
|
366
|
+
await access(current, constants.F_OK);
|
|
367
|
+
return current;
|
|
368
|
+
}
|
|
369
|
+
catch (error) {
|
|
370
|
+
if (error.code !== "ENOENT" || current === dirname(current))
|
|
371
|
+
throw error;
|
|
372
|
+
current = dirname(current);
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
async function install(deviceInfo, saved, noBrowser = false) {
|
|
320
377
|
const { platform, arch } = deviceInfo;
|
|
321
378
|
const server = endpoint(process.env.ZPATCH_GATEWAY || saved?.gateway || gatewayDefault);
|
|
322
|
-
const session = await authenticate(server, saved);
|
|
323
379
|
const requested = process.env.ZPATCH_VERSION;
|
|
324
380
|
if (requested && !versionPattern.test(requested))
|
|
325
381
|
throw Error("invalid version");
|
|
382
|
+
const directory = await installDirectory();
|
|
383
|
+
await access(directory, constants.W_OK);
|
|
384
|
+
await checkSpace(directory, 16n << 20n);
|
|
385
|
+
console.error(`Preparing zpatch for ${platform}${deviceInfo.libc ? ` (${deviceInfo.libc})` : ""} with Node.js ${process.versions.node}.`);
|
|
386
|
+
const session = await authenticate(server, saved, noBrowser);
|
|
326
387
|
const release = requested ? "/releases/" + platform + "/" + requested : "/releases/latest?platform=" + platform;
|
|
327
388
|
const meta = await jsonRequest(new URL(release, server), { headers: { Authorization: "Bearer " + session.token } });
|
|
328
389
|
const size = meta.size_bytes ?? meta.bytes;
|
|
@@ -341,6 +402,7 @@ async function install(deviceInfo, saved) {
|
|
|
341
402
|
await privateDirectory(bin);
|
|
342
403
|
await checkSpace(bin, BigInt(size) + BigInt(unpacked) + BigInt(16 << 20));
|
|
343
404
|
const url = downloadURL(meta.url, server);
|
|
405
|
+
console.error(`Downloading zpatch ${version} for ${platform} (${(size / 1048576).toFixed(1)} MiB)…`);
|
|
344
406
|
const locked = await mkdtemp(join(bin, "release-"));
|
|
345
407
|
const stage = await mkdtemp(join(bin, ".download-")).catch(async (error) => {
|
|
346
408
|
await rm(locked, { recursive: true, force: true });
|
|
@@ -361,19 +423,25 @@ async function install(deviceInfo, saved) {
|
|
|
361
423
|
throw Error("download failed");
|
|
362
424
|
}
|
|
363
425
|
const hash = createHash("sha256");
|
|
364
|
-
let received = 0;
|
|
426
|
+
let received = 0, reported = 0;
|
|
365
427
|
const meter = new Transform({
|
|
366
428
|
transform(chunk, _encoding, done) {
|
|
367
429
|
received += chunk.length;
|
|
368
430
|
if (received > size)
|
|
369
431
|
return done(Error("oversized download"));
|
|
370
432
|
hash.update(chunk);
|
|
433
|
+
const progress = Math.floor(received * 100 / size);
|
|
434
|
+
if (process.stderr.isTTY && progress >= reported + 10 && progress < 100) {
|
|
435
|
+
reported = progress;
|
|
436
|
+
console.error(`Downloaded ${progress}%`);
|
|
437
|
+
}
|
|
371
438
|
done(null, chunk);
|
|
372
439
|
},
|
|
373
440
|
});
|
|
374
441
|
await pipeline(Readable.fromWeb(response.body), meter, createWriteStream(tmp, { flags: "wx", mode: 0o700 }));
|
|
375
442
|
if (received !== size || hash.digest("hex") !== meta.sha256)
|
|
376
443
|
throw Error("binary SHA-256 mismatch");
|
|
444
|
+
console.error("Download verified. Installing zpatch…");
|
|
377
445
|
const executable = join(locked, process.platform === "win32" ? "zpatch.exe" : "zpatch");
|
|
378
446
|
if (isBundle)
|
|
379
447
|
await extractBundle(tmp, locked, unpacked);
|
|
@@ -409,40 +477,113 @@ async function installed(config, platform) {
|
|
|
409
477
|
throw Error("installed binary checksum mismatch");
|
|
410
478
|
return executable;
|
|
411
479
|
}
|
|
480
|
+
function validateTarget(value) {
|
|
481
|
+
if (typeof value !== "string" || Buffer.from(value).toString("utf8") !== value || Buffer.byteLength(value, "utf8") > 65535 ||
|
|
482
|
+
/[\\:\p{Cc}]/u.test(value) || value.split("/").some(part => !part.trim() || part === "." || part === ".."))
|
|
483
|
+
throw Error("invalid ZIP target: use a filename or a relative internal path");
|
|
484
|
+
}
|
|
485
|
+
async function archiveConfig(args) {
|
|
486
|
+
const [action, key, value] = args;
|
|
487
|
+
if (key !== "default-target" || !(action === "set" && args.length === 3 ||
|
|
488
|
+
action === "reset" && args.length === 2 ||
|
|
489
|
+
action === "get" && (args.length === 2 || args.length === 3 && value === "--json")))
|
|
490
|
+
throw Error("Usage: zpatch config get default-target [--json], set default-target <name>, or reset default-target");
|
|
491
|
+
const configured = join(base, "config.json");
|
|
492
|
+
const readConfig = async () => {
|
|
493
|
+
const raw = await readFile(configured, "utf8").catch((error) => {
|
|
494
|
+
if (error.code === "ENOENT")
|
|
495
|
+
return "{}";
|
|
496
|
+
throw error;
|
|
497
|
+
});
|
|
498
|
+
const data = JSON.parse(raw);
|
|
499
|
+
if (!data || typeof data !== "object" || Array.isArray(data))
|
|
500
|
+
throw Error("config.json must contain a JSON object");
|
|
501
|
+
return data;
|
|
502
|
+
};
|
|
503
|
+
if (action === "get") {
|
|
504
|
+
let target = process.env.ZPATCH_DEFAULT_TARGET ?? process.env.ZPATCH_TARGET;
|
|
505
|
+
let source = "env";
|
|
506
|
+
if (target === undefined) {
|
|
507
|
+
const config = await readConfig();
|
|
508
|
+
const present = Object.hasOwn(config, "default_target");
|
|
509
|
+
target = present ? config.default_target : "123.txt";
|
|
510
|
+
source = present ? "config" : "builtin_default";
|
|
511
|
+
}
|
|
512
|
+
validateTarget(target);
|
|
513
|
+
console.log(value === "--json" ? JSON.stringify({ target, target_source: source }) : target);
|
|
514
|
+
return;
|
|
515
|
+
}
|
|
516
|
+
if (action === "set")
|
|
517
|
+
validateTarget(value);
|
|
518
|
+
await privateDirectory(base, true);
|
|
519
|
+
const data = await readConfig();
|
|
520
|
+
if (action === "set")
|
|
521
|
+
data.default_target = value;
|
|
522
|
+
else if (!Object.hasOwn(data, "default_target"))
|
|
523
|
+
return;
|
|
524
|
+
else
|
|
525
|
+
delete data.default_target;
|
|
526
|
+
const tmp = join(base, ".config-" + randomBytes(12).toString("hex"));
|
|
527
|
+
try {
|
|
528
|
+
const out = await open(tmp, "wx", 0o600);
|
|
529
|
+
try {
|
|
530
|
+
await out.writeFile(JSON.stringify(data, null, 2) + "\n");
|
|
531
|
+
await out.sync();
|
|
532
|
+
}
|
|
533
|
+
finally {
|
|
534
|
+
await out.close();
|
|
535
|
+
}
|
|
536
|
+
await rename(tmp, configured);
|
|
537
|
+
}
|
|
538
|
+
finally {
|
|
539
|
+
await rm(tmp, { force: true });
|
|
540
|
+
}
|
|
541
|
+
}
|
|
412
542
|
async function main() {
|
|
543
|
+
if (Number(process.versions.node.split(".")[0]) < 22)
|
|
544
|
+
throw Error("Install Node.js 22 or newer to run zpatch.");
|
|
413
545
|
const args = process.argv.slice(2);
|
|
546
|
+
if (args[0] === "config")
|
|
547
|
+
return archiveConfig(args.slice(1));
|
|
414
548
|
const system = await device();
|
|
549
|
+
const noBrowser = args.length === 1 && args[0] === "--no-browser" ||
|
|
550
|
+
args.length === 2 && ["login", "update"].includes(args[0]) && args[1] === "--no-browser";
|
|
415
551
|
if (args[0] === "login")
|
|
416
|
-
return install(system);
|
|
552
|
+
return install(system, undefined, noBrowser);
|
|
417
553
|
if (args[0] === "update") {
|
|
418
554
|
const saved = await readFile(credentials, "utf8").then(content => JSON.parse(content)).catch(() => undefined);
|
|
419
|
-
return install(system, saved);
|
|
555
|
+
return install(system, saved, noBrowser);
|
|
420
556
|
}
|
|
421
557
|
if (args[0] === "doctor") {
|
|
422
|
-
const directory = await
|
|
558
|
+
const directory = await installDirectory();
|
|
423
559
|
const space = await statfs(directory, { bigint: true });
|
|
560
|
+
const writable = await access(directory, constants.W_OK).then(() => true, () => false);
|
|
424
561
|
const health = await readFile(credentials, "utf8").then(content => installed(JSON.parse(content), system.platform)).then(() => "verified").catch((error) => error.code === "ENOENT" ? "missing" : "invalid");
|
|
425
|
-
console.log(JSON.stringify({ ...system,
|
|
562
|
+
console.log(JSON.stringify({ ...system, os: process.platform, os_release: release(), hardware_arch: machine(),
|
|
563
|
+
node_version: process.versions.node, logical_cpus: availableParallelism(), memory_bytes: totalmem(),
|
|
564
|
+
free_bytes: (space.bavail * space.bsize).toString(), install_directory_writable: writable, installation: health }));
|
|
426
565
|
if (health === "invalid")
|
|
427
566
|
process.exitCode = 3;
|
|
428
567
|
return;
|
|
429
568
|
}
|
|
430
|
-
|
|
569
|
+
let content = await readFile(credentials, "utf8").catch((error) => {
|
|
431
570
|
if (error.code === "ENOENT")
|
|
432
571
|
return null;
|
|
433
572
|
throw error;
|
|
434
573
|
});
|
|
435
574
|
if (content === null) {
|
|
436
575
|
const setup = "Run `zpatch login` to sign in and install zpatch. Then run `zpatch` again.";
|
|
437
|
-
if (args.length
|
|
576
|
+
if (args.length === 1 && ["--help", "-h"].includes(args[0]))
|
|
577
|
+
return console.log(setup);
|
|
578
|
+
if (args.length && !noBrowser)
|
|
438
579
|
throw Error(setup);
|
|
439
|
-
|
|
440
|
-
|
|
580
|
+
await install(system, undefined, noBrowser);
|
|
581
|
+
content = await readFile(credentials, "utf8");
|
|
441
582
|
}
|
|
442
583
|
const config = JSON.parse(content);
|
|
443
584
|
const executable = await installed(config, system.platform);
|
|
444
585
|
const cleanEnv = Object.fromEntries(Object.entries(process.env).filter(([key]) => !secureNames.test(key)));
|
|
445
|
-
const child = spawn(executable, args, { stdio: "inherit", env: cleanEnv });
|
|
586
|
+
const child = spawn(executable, noBrowser ? [] : args, { stdio: "inherit", env: cleanEnv });
|
|
446
587
|
for (const signal of ["SIGINT", "SIGTERM"])
|
|
447
588
|
process.on(signal, () => child.kill(signal));
|
|
448
589
|
process.exitCode = await new Promise((resolveExit, reject) => {
|