@spectratools/assembly-cli 0.4.0 → 0.4.1
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/dist/cli.js +12 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
// src/cli.ts
|
|
4
|
+
import { realpathSync } from "fs";
|
|
4
5
|
import { fileURLToPath } from "url";
|
|
5
6
|
import { Cli as Cli6, z as z6 } from "incur";
|
|
6
7
|
|
|
@@ -6134,7 +6135,17 @@ cli.command("health", {
|
|
|
6134
6135
|
}
|
|
6135
6136
|
});
|
|
6136
6137
|
applyFriendlyErrorHandling(cli);
|
|
6137
|
-
var isMain =
|
|
6138
|
+
var isMain = (() => {
|
|
6139
|
+
const entrypoint = process.argv[1];
|
|
6140
|
+
if (!entrypoint) {
|
|
6141
|
+
return false;
|
|
6142
|
+
}
|
|
6143
|
+
try {
|
|
6144
|
+
return realpathSync(entrypoint) === realpathSync(fileURLToPath(import.meta.url));
|
|
6145
|
+
} catch {
|
|
6146
|
+
return false;
|
|
6147
|
+
}
|
|
6148
|
+
})();
|
|
6138
6149
|
if (isMain) {
|
|
6139
6150
|
cli.serve();
|
|
6140
6151
|
}
|