@companyhelm/cli 0.1.5 → 0.2.0

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.d.ts CHANGED
@@ -1 +1,2 @@
1
+ #!/usr/bin/env node
1
2
  export declare function main(argv?: string[]): Promise<void>;
package/dist/cli.js CHANGED
@@ -1,3 +1,6 @@
1
+ #!/usr/bin/env node
2
+ import { realpathSync } from "node:fs";
3
+ import { pathToFileURL } from "node:url";
1
4
  import { buildProgram } from "./commands/register-commands.js";
2
5
  import { InteractiveCommandCancelledError } from "./commands/interactive.js";
3
6
  export async function main(argv = process.argv) {
@@ -13,6 +16,13 @@ export async function main(argv = process.argv) {
13
16
  throw error;
14
17
  }
15
18
  }
16
- if (import.meta.url === `file://${process.argv[1]}`) {
19
+ function isCliEntrypoint(argv = process.argv) {
20
+ const entrypointPath = argv[1];
21
+ if (!entrypointPath) {
22
+ return false;
23
+ }
24
+ return pathToFileURL(realpathSync(entrypointPath)).href === import.meta.url;
25
+ }
26
+ if (isCliEntrypoint()) {
17
27
  void main();
18
28
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@companyhelm/cli",
3
- "version": "0.1.5",
3
+ "version": "0.2.0",
4
4
  "description": "Bootstrap and manage a local CompanyHelm deployment.",
5
5
  "license": "MIT",
6
6
  "private": false,