@sharedots/cli 0.1.2 → 0.1.4

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/.gitkeep ADDED
@@ -0,0 +1 @@
1
+ # keep folder in git
@@ -0,0 +1,19 @@
1
+ #!/usr/bin/env node
2
+ import { spawn } from "node:child_process";
3
+ import { existsSync } from "node:fs";
4
+ import { dirname, join } from "node:path";
5
+ import { fileURLToPath } from "node:url";
6
+
7
+ const __dirname = dirname(fileURLToPath(import.meta.url));
8
+ const isWin = process.platform === "win32";
9
+ const nativeExe = join(__dirname, isWin ? "sharedots-daemon.exe" : "sharedots-daemon");
10
+
11
+ if (existsSync(nativeExe)) {
12
+ const child = spawn(nativeExe, process.argv.slice(2), { stdio: "inherit" });
13
+ child.on("exit", (code) => process.exit(code ?? 0));
14
+ } else {
15
+ // Graceful fallback to pure Node.js worker
16
+ const nodeWorker = join(__dirname, "..", "dist", "node-worker.js");
17
+ const child = spawn(process.execPath, [nodeWorker, ...process.argv.slice(2)], { stdio: "inherit" });
18
+ child.on("exit", (code) => process.exit(code ?? 0));
19
+ }
Binary file