htn-tunnel 0.3.2 → 0.3.3
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/htn-tunnel.js +20 -0
- package/package.json +1 -1
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Shim: finds and executes the htn-tunnel binary downloaded by postinstall.
|
|
3
|
+
const path = require("path");
|
|
4
|
+
const os = require("os");
|
|
5
|
+
const fs = require("fs");
|
|
6
|
+
|
|
7
|
+
const ext = os.platform() === "win32" ? ".exe" : "";
|
|
8
|
+
const binPath = path.join(__dirname, `htn-tunnel${ext}`);
|
|
9
|
+
|
|
10
|
+
if (!fs.existsSync(binPath)) {
|
|
11
|
+
console.error("htn-tunnel: binary not found. Try reinstalling:");
|
|
12
|
+
console.error(" npm install -g htn-tunnel");
|
|
13
|
+
process.exit(1);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const result = require("child_process").spawnSync(binPath, process.argv.slice(2), {
|
|
17
|
+
stdio: "inherit",
|
|
18
|
+
windowsHide: false,
|
|
19
|
+
});
|
|
20
|
+
process.exit(result.status ?? 1);
|