@goodfoot/wiki 0.5.16 → 0.5.19
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/wiki +4 -20
- package/package.json +6 -6
- package/scripts/postinstall.js +8 -12
package/bin/wiki
CHANGED
|
@@ -1,20 +1,4 @@
|
|
|
1
|
-
#!/
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const path = require("path");
|
|
6
|
-
const fs = require("fs");
|
|
7
|
-
|
|
8
|
-
const binaryName = process.platform === "win32" ? "wiki.exe" : "wiki";
|
|
9
|
-
const nativePath = path.join(__dirname, "..", "lib", binaryName);
|
|
10
|
-
|
|
11
|
-
if (!fs.existsSync(nativePath)) {
|
|
12
|
-
process.stderr.write(
|
|
13
|
-
"@goodfoot/wiki: Native binary not found.\n" +
|
|
14
|
-
"Try reinstalling: npm install @goodfoot/wiki\n"
|
|
15
|
-
);
|
|
16
|
-
process.exit(1);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
const result = spawnSync(nativePath, process.argv.slice(2), { stdio: "inherit" });
|
|
20
|
-
process.exit(result.status ?? 1);
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
# Replaced by postinstall with a symlink to the native binary.
|
|
3
|
+
echo "@goodfoot/wiki: Installation incomplete. Run 'npm install @goodfoot/wiki' to finish setup." >&2
|
|
4
|
+
exit 1
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@goodfoot/wiki",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.19",
|
|
4
4
|
"bin": "bin/wiki",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"postinstall": "node scripts/postinstall.js",
|
|
@@ -15,11 +15,11 @@
|
|
|
15
15
|
"scripts/postinstall.js"
|
|
16
16
|
],
|
|
17
17
|
"optionalDependencies": {
|
|
18
|
-
"@goodfoot/wiki-darwin-arm64": "0.5.
|
|
19
|
-
"@goodfoot/wiki-darwin-x64": "0.5.
|
|
20
|
-
"@goodfoot/wiki-linux-arm64": "0.5.
|
|
21
|
-
"@goodfoot/wiki-linux-x64": "0.5.
|
|
22
|
-
"@goodfoot/wiki-win32-x64": "0.5.
|
|
18
|
+
"@goodfoot/wiki-darwin-arm64": "0.5.19",
|
|
19
|
+
"@goodfoot/wiki-darwin-x64": "0.5.19",
|
|
20
|
+
"@goodfoot/wiki-linux-arm64": "0.5.19",
|
|
21
|
+
"@goodfoot/wiki-linux-x64": "0.5.19",
|
|
22
|
+
"@goodfoot/wiki-win32-x64": "0.5.19"
|
|
23
23
|
},
|
|
24
24
|
"repository": {
|
|
25
25
|
"type": "git",
|
package/scripts/postinstall.js
CHANGED
|
@@ -26,7 +26,7 @@ function main() {
|
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
const packageName = `@goodfoot/wiki-${platform}-${arch}`;
|
|
29
|
-
const
|
|
29
|
+
const sourceBinaryName = process.platform === 'win32' ? 'wiki.exe' : 'wiki';
|
|
30
30
|
|
|
31
31
|
let packageDir;
|
|
32
32
|
try {
|
|
@@ -37,33 +37,29 @@ function main() {
|
|
|
37
37
|
process.exit(0);
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
const sourceBinary = path.join(packageDir, 'bin',
|
|
40
|
+
const sourceBinary = path.join(packageDir, 'bin', sourceBinaryName);
|
|
41
41
|
if (!fs.existsSync(sourceBinary)) {
|
|
42
42
|
console.log(`@goodfoot/wiki: Binary not found in ${packageName}. The package may not have been published yet.`);
|
|
43
43
|
process.exit(0);
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
const
|
|
47
|
-
const targetBinary = path.join(targetDir, binaryName);
|
|
46
|
+
const binWiki = path.join(__dirname, '..', 'bin', 'wiki');
|
|
48
47
|
|
|
49
|
-
fs.mkdirSync(targetDir, { recursive: true });
|
|
50
|
-
|
|
51
|
-
// Remove existing binary if present
|
|
52
48
|
try {
|
|
53
|
-
fs.unlinkSync(
|
|
49
|
+
fs.unlinkSync(binWiki);
|
|
54
50
|
} catch {
|
|
55
51
|
// Ignore if it doesn't exist
|
|
56
52
|
}
|
|
57
53
|
|
|
58
54
|
// Try symlink first, fall back to copy
|
|
59
55
|
try {
|
|
60
|
-
fs.symlinkSync(sourceBinary,
|
|
56
|
+
fs.symlinkSync(sourceBinary, binWiki);
|
|
61
57
|
} catch {
|
|
62
|
-
fs.copyFileSync(sourceBinary,
|
|
63
|
-
fs.chmodSync(
|
|
58
|
+
fs.copyFileSync(sourceBinary, binWiki);
|
|
59
|
+
fs.chmodSync(binWiki, 0o755);
|
|
64
60
|
}
|
|
65
61
|
|
|
66
|
-
console.log(`@goodfoot/wiki: Installed
|
|
62
|
+
console.log(`@goodfoot/wiki: Installed wiki from ${packageName}`);
|
|
67
63
|
}
|
|
68
64
|
|
|
69
65
|
main();
|