@wraps.dev/cli 2.17.22 → 2.17.23
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/cli.js
CHANGED
|
@@ -9497,8 +9497,14 @@ var update_exports = {};
|
|
|
9497
9497
|
__export(update_exports, {
|
|
9498
9498
|
update: () => update
|
|
9499
9499
|
});
|
|
9500
|
-
import {
|
|
9501
|
-
import {
|
|
9500
|
+
import { execFileSync } from "child_process";
|
|
9501
|
+
import {
|
|
9502
|
+
chmodSync,
|
|
9503
|
+
createWriteStream,
|
|
9504
|
+
mkdirSync as mkdirSync3,
|
|
9505
|
+
mkdtempSync,
|
|
9506
|
+
rmSync
|
|
9507
|
+
} from "fs";
|
|
9502
9508
|
import { homedir as homedir4, tmpdir as tmpdir2 } from "os";
|
|
9503
9509
|
import { join as join21 } from "path";
|
|
9504
9510
|
import { Readable } from "stream";
|
|
@@ -9610,8 +9616,8 @@ async function update(currentVersion) {
|
|
|
9610
9616
|
throw new Error("Tarball not found in CHECKSUMS.sha256");
|
|
9611
9617
|
}
|
|
9612
9618
|
const expected = line.split(WHITESPACE_RE)[0];
|
|
9613
|
-
const shaCmd = process.platform === "darwin" ? "shasum -a 256" : "sha256sum";
|
|
9614
|
-
const actual =
|
|
9619
|
+
const [shaCmd, ...shaArgs] = process.platform === "darwin" ? ["shasum", "-a", "256"] : ["sha256sum"];
|
|
9620
|
+
const actual = execFileSync(shaCmd, [...shaArgs, tarballPath]).toString().split(WHITESPACE_RE)[0];
|
|
9615
9621
|
if (expected !== actual) {
|
|
9616
9622
|
throw new Error(
|
|
9617
9623
|
`Checksum mismatch (expected ${expected}, got ${actual})`
|
|
@@ -9621,15 +9627,15 @@ async function update(currentVersion) {
|
|
|
9621
9627
|
}
|
|
9622
9628
|
await progress.execute("Installing update...", async () => {
|
|
9623
9629
|
const extractDir = join21(tmp, "extract");
|
|
9624
|
-
|
|
9625
|
-
|
|
9630
|
+
mkdirSync3(extractDir, { recursive: true });
|
|
9631
|
+
execFileSync("tar", ["xzf", tarballPath, "-C", extractDir]);
|
|
9626
9632
|
const source = join21(extractDir, "wraps");
|
|
9627
9633
|
for (const dir of ["bin", "runtime", "lib"]) {
|
|
9628
|
-
|
|
9629
|
-
|
|
9634
|
+
rmSync(join21(INSTALL_DIR, dir), { recursive: true, force: true });
|
|
9635
|
+
execFileSync("cp", ["-R", join21(source, dir), join21(INSTALL_DIR, dir)]);
|
|
9630
9636
|
}
|
|
9631
|
-
|
|
9632
|
-
|
|
9637
|
+
chmodSync(join21(INSTALL_DIR, "bin", "wraps"), 493);
|
|
9638
|
+
chmodSync(join21(INSTALL_DIR, "runtime", "node"), 493);
|
|
9633
9639
|
});
|
|
9634
9640
|
console.log();
|
|
9635
9641
|
progress.succeed(
|