@goodfoot/wiki 0.5.18 → 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 ADDED
@@ -0,0 +1,4 @@
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.18",
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.18",
19
- "@goodfoot/wiki-darwin-x64": "0.5.18",
20
- "@goodfoot/wiki-linux-arm64": "0.5.18",
21
- "@goodfoot/wiki-linux-x64": "0.5.18",
22
- "@goodfoot/wiki-win32-x64": "0.5.18"
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",
@@ -27,7 +27,6 @@ function main() {
27
27
 
28
28
  const packageName = `@goodfoot/wiki-${platform}-${arch}`;
29
29
  const sourceBinaryName = process.platform === 'win32' ? 'wiki.exe' : 'wiki';
30
- const runtimeBinaryName = 'wiki';
31
30
 
32
31
  let packageDir;
33
32
  try {
@@ -44,32 +43,23 @@ function main() {
44
43
  process.exit(0);
45
44
  }
46
45
 
47
- const targetDir = path.join(__dirname, '..', 'lib');
48
- const runtimeBinary = path.join(targetDir, runtimeBinaryName);
46
+ const binWiki = path.join(__dirname, '..', 'bin', 'wiki');
49
47
 
50
- fs.mkdirSync(targetDir, { recursive: true });
51
-
52
- for (const targetPath of [runtimeBinary, path.join(targetDir, sourceBinaryName)]) {
53
- try {
54
- fs.unlinkSync(targetPath);
55
- } catch {
56
- // Ignore if it doesn't exist
57
- }
48
+ try {
49
+ fs.unlinkSync(binWiki);
50
+ } catch {
51
+ // Ignore if it doesn't exist
58
52
  }
59
53
 
60
54
  // Try symlink first, fall back to copy
61
55
  try {
62
- fs.symlinkSync(sourceBinary, runtimeBinary);
56
+ fs.symlinkSync(sourceBinary, binWiki);
63
57
  } catch {
64
- fs.copyFileSync(sourceBinary, runtimeBinary);
65
- fs.chmodSync(runtimeBinary, 0o755);
66
- }
67
-
68
- if (sourceBinaryName !== runtimeBinaryName) {
69
- fs.copyFileSync(runtimeBinary, path.join(targetDir, sourceBinaryName));
58
+ fs.copyFileSync(sourceBinary, binWiki);
59
+ fs.chmodSync(binWiki, 0o755);
70
60
  }
71
61
 
72
- console.log(`@goodfoot/wiki: Installed ${runtimeBinaryName} from ${packageName}`);
62
+ console.log(`@goodfoot/wiki: Installed wiki from ${packageName}`);
73
63
  }
74
64
 
75
65
  main();