cloudflare-mcp-smart-proxy 1.5.2 → 1.5.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/connector-cli.js +11 -2
- package/package.json +1 -1
package/connector-cli.js
CHANGED
|
@@ -380,8 +380,17 @@ async function main() {
|
|
|
380
380
|
}
|
|
381
381
|
}
|
|
382
382
|
|
|
383
|
-
|
|
383
|
+
function isMainEntrypoint(entrypoint = process.argv[1]) {
|
|
384
|
+
if (!entrypoint) return false;
|
|
385
|
+
try {
|
|
386
|
+
return fs.realpathSync(entrypoint) === fs.realpathSync(__filename);
|
|
387
|
+
} catch {
|
|
388
|
+
return path.resolve(entrypoint) === __filename;
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
if (isMainEntrypoint()) {
|
|
384
393
|
main();
|
|
385
394
|
}
|
|
386
395
|
|
|
387
|
-
export { parseArgs };
|
|
396
|
+
export { isMainEntrypoint, parseArgs };
|