@reqvire-org/reqvire 0.0.0 → 0.14.0
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.
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/bin/reqvire.js
CHANGED
|
@@ -1,5 +1,83 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
const childProcess = require("child_process");
|
|
4
|
+
const fs = require("fs");
|
|
5
|
+
const os = require("os");
|
|
6
|
+
const path = require("path");
|
|
5
7
|
|
|
8
|
+
const packageJson = require("../package.json");
|
|
9
|
+
|
|
10
|
+
function target() {
|
|
11
|
+
if (process.platform === "linux" && process.arch === "x64") {
|
|
12
|
+
return {
|
|
13
|
+
archive: "reqvire-linux-x86_64.tar.gz",
|
|
14
|
+
extracted: "reqvire-linux-x86_64"
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
if (process.platform === "darwin" && process.arch === "arm64") {
|
|
19
|
+
return {
|
|
20
|
+
archive: "reqvire-darwin-arm64.tar.gz",
|
|
21
|
+
extracted: "reqvire-darwin-arm64"
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
if (process.platform === "darwin" && process.arch === "x64") {
|
|
26
|
+
return {
|
|
27
|
+
archive: "reqvire-darwin-x86_64.tar.gz",
|
|
28
|
+
extracted: "reqvire-darwin-x86_64"
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
console.error(
|
|
33
|
+
`Unsupported platform for @reqvire-org/reqvire: ${process.platform}/${process.arch}`
|
|
34
|
+
);
|
|
35
|
+
process.exit(1);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
const selected = target();
|
|
39
|
+
const packageRoot = path.resolve(__dirname, "..");
|
|
40
|
+
const archivePath = path.join(packageRoot, "artifacts", selected.archive);
|
|
41
|
+
const cacheDir = path.join(
|
|
42
|
+
os.tmpdir(),
|
|
43
|
+
"reqvire-npm",
|
|
44
|
+
`${packageJson.version}-${process.platform}-${process.arch}`
|
|
45
|
+
);
|
|
46
|
+
const binaryPath = path.join(cacheDir, "reqvire");
|
|
47
|
+
|
|
48
|
+
if (!fs.existsSync(archivePath)) {
|
|
49
|
+
console.error(`Missing Reqvire archive: ${archivePath}`);
|
|
50
|
+
process.exit(1);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
if (!fs.existsSync(binaryPath)) {
|
|
54
|
+
fs.rmSync(cacheDir, { recursive: true, force: true });
|
|
55
|
+
fs.mkdirSync(cacheDir, { recursive: true });
|
|
56
|
+
|
|
57
|
+
const extract = childProcess.spawnSync("tar", ["-xzf", archivePath, "-C", cacheDir], {
|
|
58
|
+
stdio: "inherit"
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
if (extract.status !== 0) {
|
|
62
|
+
process.exit(extract.status || 1);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
const extractedPath = path.join(cacheDir, selected.extracted);
|
|
66
|
+
fs.renameSync(extractedPath, binaryPath);
|
|
67
|
+
fs.chmodSync(binaryPath, 0o755);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
const result = childProcess.spawnSync(binaryPath, process.argv.slice(2), {
|
|
71
|
+
stdio: "inherit"
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
if (result.error) {
|
|
75
|
+
console.error(result.error.message);
|
|
76
|
+
process.exit(1);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
if (result.signal) {
|
|
80
|
+
process.kill(process.pid, result.signal);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
process.exit(result.status === null ? 1 : result.status);
|
package/package.json
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reqvire-org/reqvire",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Reqvire
|
|
5
|
-
"main": "index.js",
|
|
6
|
-
"scripts": {
|
|
7
|
-
"test": "echo \"Error: no test specified\" && exit 1"
|
|
8
|
-
},
|
|
9
|
-
"keywords": [],
|
|
10
|
-
"author": "",
|
|
3
|
+
"version": "0.14.0",
|
|
4
|
+
"description": "Reqvire requirements and traceability management CLI",
|
|
11
5
|
"license": "Apache-2.0",
|
|
12
|
-
"
|
|
6
|
+
"homepage": "https://www.reqvire.org",
|
|
13
7
|
"repository": {
|
|
14
8
|
"type": "git",
|
|
15
9
|
"url": "git+https://github.com/reqvire-org/reqvire.git"
|
|
16
10
|
},
|
|
17
|
-
"homepage": "https://www.reqvire.org",
|
|
18
11
|
"bin": {
|
|
19
|
-
"reqvire": "
|
|
12
|
+
"reqvire": "bin/reqvire.js"
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"bin/",
|
|
16
|
+
"artifacts/"
|
|
17
|
+
],
|
|
18
|
+
"publishConfig": {
|
|
19
|
+
"access": "public"
|
|
20
20
|
}
|
|
21
21
|
}
|