renview 0.0.6 → 0.0.9
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/package.json +7 -6
- package/postinstall.mjs +5 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "renview",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.9",
|
|
4
4
|
"description": "帮助人类降低认知负担的代码审核工具",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"bin": {
|
|
@@ -19,11 +19,12 @@
|
|
|
19
19
|
"x64"
|
|
20
20
|
],
|
|
21
21
|
"optionalDependencies": {
|
|
22
|
-
"renview-darwin-arm64": "0.0.
|
|
23
|
-
"renview-darwin-x64": "0.0.
|
|
24
|
-
"renview-linux-x64": "0.0.
|
|
25
|
-
"renview-linux-arm64": "0.0.
|
|
26
|
-
"renview-windows-x64": "0.0.
|
|
22
|
+
"renview-darwin-arm64": "0.0.9",
|
|
23
|
+
"renview-darwin-x64": "0.0.9",
|
|
24
|
+
"renview-linux-x64": "0.0.9",
|
|
25
|
+
"renview-linux-arm64": "0.0.9",
|
|
26
|
+
"renview-windows-x64": "0.0.9",
|
|
27
|
+
"renview-windows-arm64": "0.0.9"
|
|
27
28
|
},
|
|
28
29
|
"repository": {
|
|
29
30
|
"type": "git",
|
package/postinstall.mjs
CHANGED
|
@@ -28,7 +28,6 @@ function fail(message) {
|
|
|
28
28
|
const platform = OS[process.platform];
|
|
29
29
|
const arch = CPU[process.arch];
|
|
30
30
|
if (!platform || !arch) fail(`unsupported platform: ${process.platform} ${process.arch}`);
|
|
31
|
-
if (platform === "windows" && arch !== "x64") fail("Windows arm64 is not supported yet; use WSL");
|
|
32
31
|
const platformPkg = `renview-${platform}-${arch}`;
|
|
33
32
|
const binName = platform === "windows" ? "renview.exe" : "renview";
|
|
34
33
|
|
|
@@ -82,7 +81,8 @@ async function fromRegistry() {
|
|
|
82
81
|
// win10+ 自带 bsdtar,macOS/Linux 必有 tar
|
|
83
82
|
execFileSync("tar", ["-xzf", tgz, "-C", tmp], { stdio: "ignore" });
|
|
84
83
|
const extracted = path.join(tmp, "package", "bin", binName);
|
|
85
|
-
if (!fs.existsSync(extracted))
|
|
84
|
+
if (!fs.existsSync(extracted))
|
|
85
|
+
fail(`tarball of ${platformPkg}@${version} has no bin/${binName}`);
|
|
86
86
|
linkBinary(extracted);
|
|
87
87
|
} finally {
|
|
88
88
|
fs.rmSync(tmp, { recursive: true, force: true });
|
|
@@ -93,7 +93,9 @@ const local = fromOptionalDependency();
|
|
|
93
93
|
if (local) {
|
|
94
94
|
linkBinary(local);
|
|
95
95
|
} else {
|
|
96
|
-
console.warn(
|
|
96
|
+
console.warn(
|
|
97
|
+
`renview: optional dependency ${platformPkg} not installed, downloading from registry…`,
|
|
98
|
+
);
|
|
97
99
|
try {
|
|
98
100
|
await fromRegistry();
|
|
99
101
|
} catch (e) {
|