@better-update/cli 0.18.0 → 0.18.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/dist/index.mjs +18 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -14,7 +14,7 @@ import { createServer } from "node:http";
|
|
|
14
14
|
import { maxBy, uniqBy } from "es-toolkit";
|
|
15
15
|
import { createHash, randomBytes, randomUUID } from "node:crypto";
|
|
16
16
|
import forge from "node-forge";
|
|
17
|
-
import { createReadStream, existsSync, promises, readFileSync, writeFileSync } from "node:fs";
|
|
17
|
+
import { accessSync, chmodSync, constants, createReadStream, existsSync, promises, readFileSync, writeFileSync } from "node:fs";
|
|
18
18
|
import { spawn as spawn$1 } from "node-pty";
|
|
19
19
|
import chalk from "chalk";
|
|
20
20
|
import os from "node:os";
|
|
@@ -31,7 +31,7 @@ var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
|
31
31
|
|
|
32
32
|
//#endregion
|
|
33
33
|
//#region package.json
|
|
34
|
-
var version = "0.18.
|
|
34
|
+
var version = "0.18.1";
|
|
35
35
|
|
|
36
36
|
//#endregion
|
|
37
37
|
//#region src/lib/interactive-mode.ts
|
|
@@ -4444,7 +4444,23 @@ const mergeEnv$1 = (overrides) => {
|
|
|
4444
4444
|
for (const [key, value] of Object.entries(overrides)) merged[key] = value;
|
|
4445
4445
|
return merged;
|
|
4446
4446
|
};
|
|
4447
|
+
let spawnHelperChecked = false;
|
|
4448
|
+
const ensureSpawnHelperExecutable = () => {
|
|
4449
|
+
if (spawnHelperChecked) return;
|
|
4450
|
+
spawnHelperChecked = true;
|
|
4451
|
+
if (process$1.platform === "win32") return;
|
|
4452
|
+
try {
|
|
4453
|
+
const nodeRequire = createRequire(import.meta.url);
|
|
4454
|
+
const helperPath = path.join(path.dirname(nodeRequire.resolve("node-pty/package.json")), "prebuilds", `${process$1.platform}-${process$1.arch}`, "spawn-helper");
|
|
4455
|
+
try {
|
|
4456
|
+
accessSync(helperPath, constants.X_OK);
|
|
4457
|
+
} catch {
|
|
4458
|
+
chmodSync(helperPath, 493);
|
|
4459
|
+
}
|
|
4460
|
+
} catch {}
|
|
4461
|
+
};
|
|
4447
4462
|
const trySpawn = (input) => {
|
|
4463
|
+
ensureSpawnHelperExecutable();
|
|
4448
4464
|
const { cols, rows } = ptyDimensions();
|
|
4449
4465
|
try {
|
|
4450
4466
|
return spawn$1(input.command, [...input.args], {
|