There was an error while loading. Please reload this page.
2 parents 7ba74d1 + bc82da1 commit 77ff111Copy full SHA for 77ff111
1 file changed
src/index.ts
@@ -1,5 +1,6 @@
1
#!/usr/bin/env node
2
-import { pathToFileURL } from "node:url";
+import { basename } from "node:path";
3
+import { fileURLToPath } from "node:url";
4
import { resolveConfig, type TunnelConfig } from "./config.js";
5
import { createTunnel } from "./tunnel.js";
6
@@ -29,9 +30,13 @@ export function runCli(): void {
29
30
}
31
32
const currentEntrypoint = process.argv[1]
- ? pathToFileURL(process.argv[1]).href
33
+ ? basename(process.argv[1])
34
: "";
35
+const isCliEntrypoint =
36
+ currentEntrypoint === "spawn-dock-tunnel" ||
37
+ currentEntrypoint === "spawndock-tunnel" ||
38
+ currentEntrypoint === basename(fileURLToPath(import.meta.url));
39
-if (currentEntrypoint === import.meta.url) {
40
+if (isCliEntrypoint) {
41
runCli();
42
0 commit comments