verus-pm 0.2.3 → 0.2.4
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/bin/verus.js +27 -0
- package/package.json +4 -4
- package/scripts/postinstall.js +5 -3
- package/bin/verus +0 -0
package/bin/verus.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const { existsSync } = require("node:fs");
|
|
4
|
+
const { spawnSync } = require("node:child_process");
|
|
5
|
+
const { join } = require("node:path");
|
|
6
|
+
|
|
7
|
+
const ext = process.platform === "win32" ? ".exe" : "";
|
|
8
|
+
const candidates = [
|
|
9
|
+
join(__dirname, `verus-native${ext}`),
|
|
10
|
+
join(__dirname, `verus${ext}`),
|
|
11
|
+
];
|
|
12
|
+
const binaryPath = candidates.find((candidate) => existsSync(candidate));
|
|
13
|
+
|
|
14
|
+
if (!binaryPath) {
|
|
15
|
+
console.error("Verus native binary is missing.");
|
|
16
|
+
console.error("Try reinstalling the package so postinstall can download it.");
|
|
17
|
+
process.exit(1);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const result = spawnSync(binaryPath, process.argv.slice(2), { stdio: "inherit" });
|
|
21
|
+
|
|
22
|
+
if (result.error) {
|
|
23
|
+
console.error(`Failed to launch Verus: ${result.error.message}`);
|
|
24
|
+
process.exit(1);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
process.exit(result.status ?? 1);
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "verus-pm",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.4",
|
|
4
4
|
"description": "AI-powered project management — CLI + Web Dashboard in one command",
|
|
5
5
|
"bin": {
|
|
6
|
-
"verus": "./bin/verus",
|
|
7
|
-
"vr": "./bin/verus"
|
|
6
|
+
"verus": "./bin/verus.js",
|
|
7
|
+
"vr": "./bin/verus.js"
|
|
8
8
|
},
|
|
9
9
|
"files": [
|
|
10
|
-
"bin",
|
|
10
|
+
"bin/verus.js",
|
|
11
11
|
"scripts",
|
|
12
12
|
"README.md",
|
|
13
13
|
"LICENSE"
|
package/scripts/postinstall.js
CHANGED
|
@@ -15,6 +15,7 @@ const https = require("node:https");
|
|
|
15
15
|
|
|
16
16
|
const binDir = join(__dirname, "..", "bin");
|
|
17
17
|
const REPO = "thanhduy1812/verus";
|
|
18
|
+
const NATIVE_BINARY_BASENAME = "verus-native";
|
|
18
19
|
|
|
19
20
|
function info(msg) { console.log(` ℹ ${msg}`); }
|
|
20
21
|
function ok(msg) { console.log(` ✅ ${msg}`); }
|
|
@@ -29,8 +30,9 @@ async function main() {
|
|
|
29
30
|
const platform = PLATFORMS[process.platform];
|
|
30
31
|
const arch = ARCHS[process.arch];
|
|
31
32
|
const ext = process.platform === "win32" ? ".exe" : "";
|
|
32
|
-
const binaryName =
|
|
33
|
+
const binaryName = `${NATIVE_BINARY_BASENAME}${ext}`;
|
|
33
34
|
const binaryPath = join(binDir, binaryName);
|
|
35
|
+
const legacyBinaryPath = join(binDir, `verus${ext}`);
|
|
34
36
|
|
|
35
37
|
if (!platform || !arch) {
|
|
36
38
|
warn(`Unsupported platform: ${process.platform}-${process.arch}`);
|
|
@@ -39,8 +41,8 @@ async function main() {
|
|
|
39
41
|
}
|
|
40
42
|
|
|
41
43
|
// Already exists? (dev build via make npm-local)
|
|
42
|
-
if (existsSync(binaryPath)) {
|
|
43
|
-
ok(`Binary exists: ${binaryPath}`);
|
|
44
|
+
if (existsSync(binaryPath) || existsSync(legacyBinaryPath)) {
|
|
45
|
+
ok(`Binary exists: ${existsSync(binaryPath) ? binaryPath : legacyBinaryPath}`);
|
|
44
46
|
return;
|
|
45
47
|
}
|
|
46
48
|
|
package/bin/verus
DELETED
|
Binary file
|