@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 CHANGED
@@ -1,20 +1,4 @@
1
- #!/usr/bin/env node
2
- "use strict";
3
-
4
- const { spawnSync } = require("child_process");
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.16",
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.16",
19
- "@goodfoot/wiki-darwin-x64": "0.5.16",
20
- "@goodfoot/wiki-linux-arm64": "0.5.16",
21
- "@goodfoot/wiki-linux-x64": "0.5.16",
22
- "@goodfoot/wiki-win32-x64": "0.5.16"
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",
@@ -26,7 +26,7 @@ function main() {
26
26
  }
27
27
 
28
28
  const packageName = `@goodfoot/wiki-${platform}-${arch}`;
29
- const binaryName = process.platform === 'win32' ? 'wiki.exe' : 'wiki';
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', binaryName);
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 targetDir = path.join(__dirname, '..', 'lib');
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(targetBinary);
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, targetBinary);
56
+ fs.symlinkSync(sourceBinary, binWiki);
61
57
  } catch {
62
- fs.copyFileSync(sourceBinary, targetBinary);
63
- fs.chmodSync(targetBinary, 0o755);
58
+ fs.copyFileSync(sourceBinary, binWiki);
59
+ fs.chmodSync(binWiki, 0o755);
64
60
  }
65
61
 
66
- console.log(`@goodfoot/wiki: Installed ${binaryName} from ${packageName}`);
62
+ console.log(`@goodfoot/wiki: Installed wiki from ${packageName}`);
67
63
  }
68
64
 
69
65
  main();