@reqvire-org/reqvire 1.3.0 → 1.3.2
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/artifacts/reqvire-darwin-arm64.tar.gz +0 -0
- package/artifacts/reqvire-darwin-x86_64.tar.gz +0 -0
- package/artifacts/reqvire-linux-x86_64.tar.gz +0 -0
- package/bin/reqvire.js +34 -13
- package/explorer-dist/.gitkeep +0 -0
- package/explorer-dist/assets/explorer.css +1 -1
- package/explorer-dist/assets/explorer.js +129 -129
- package/explorer-dist/assets/flowLayout.worker-BgEwn2y-.js +24 -0
- package/explorer-dist/assets/forceAtlasLayout.worker-B5LN30lH.js +1 -0
- package/package.json +1 -1
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/bin/reqvire.js
CHANGED
|
@@ -51,20 +51,41 @@ if (!fs.existsSync(archivePath)) {
|
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
if (!fs.existsSync(binaryPath)) {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
54
|
+
// Every invocation owns its extraction. Publish the complete executable with
|
|
55
|
+
// an atomic no-overwrite link; a competing publisher keeps its winning inode.
|
|
56
|
+
let staging;
|
|
57
|
+
try {
|
|
58
|
+
fs.mkdirSync(cacheDir, { recursive: true });
|
|
59
|
+
staging = fs.mkdtempSync(path.join(path.dirname(cacheDir), ".extract-"));
|
|
60
|
+
const extract = childProcess.spawnSync("tar", ["-xzf", archivePath, "-C", staging], {
|
|
61
|
+
stdio: "inherit"
|
|
62
|
+
});
|
|
63
|
+
if (extract.error) throw extract.error;
|
|
64
|
+
if (extract.status !== 0) {
|
|
65
|
+
throw new Error(`Reqvire archive extraction failed (${extract.signal || extract.status})`);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
const extractedPath = path.join(staging, selected.extracted);
|
|
69
|
+
if (!fs.lstatSync(extractedPath).isFile()) {
|
|
70
|
+
throw new Error("Reqvire archive does not contain a regular native executable");
|
|
71
|
+
}
|
|
72
|
+
fs.chmodSync(extractedPath, 0o755);
|
|
73
|
+
try {
|
|
74
|
+
fs.linkSync(extractedPath, binaryPath);
|
|
75
|
+
} catch (error) {
|
|
76
|
+
if (error.code !== "EEXIST") throw error;
|
|
77
|
+
if (!fs.lstatSync(binaryPath).isFile()) {
|
|
78
|
+
throw new Error(`Invalid Reqvire executable cache: ${binaryPath}`);
|
|
79
|
+
}
|
|
80
|
+
fs.accessSync(binaryPath, fs.constants.X_OK);
|
|
81
|
+
}
|
|
82
|
+
} catch (error) {
|
|
83
|
+
console.error(error.message);
|
|
84
|
+
process.exitCode = 1;
|
|
85
|
+
} finally {
|
|
86
|
+
if (staging) fs.rmSync(staging, { recursive: true, force: true });
|
|
63
87
|
}
|
|
64
|
-
|
|
65
|
-
const extractedPath = path.join(cacheDir, selected.extracted);
|
|
66
|
-
fs.renameSync(extractedPath, binaryPath);
|
|
67
|
-
fs.chmodSync(binaryPath, 0o755);
|
|
88
|
+
if (process.exitCode) process.exit(process.exitCode);
|
|
68
89
|
}
|
|
69
90
|
|
|
70
91
|
const result = childProcess.spawnSync(binaryPath, process.argv.slice(2), {
|
|
File without changes
|