vouchington-tooling 0.0.0 → 0.0.2

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.
Files changed (2) hide show
  1. package/dist/cli/index.mjs +10 -2
  2. package/package.json +1 -1
@@ -1,5 +1,6 @@
1
1
  #!/usr/bin/env node
2
- import { readFileSync } from 'node:fs';
2
+ import { readFileSync, realpathSync } from 'node:fs';
3
+ import { resolve } from 'node:path';
3
4
  import { pathToFileURL } from 'node:url';
4
5
  import { readPackageVersion } from '../package-version.mjs';
5
6
  import { runRunnerPortPolicy } from './commands/runner-port-policy.mjs';
@@ -29,7 +30,14 @@ function readInstalledVersion() {
29
30
  return readPackageVersion(JSON.parse(readFileSync(new URL('../../package.json', import.meta.url), 'utf8')));
30
31
  }
31
32
  export function isMainModule(metaUrl, argv1) {
32
- return argv1 !== undefined && metaUrl === pathToFileURL(argv1).href;
33
+ if (argv1 === undefined)
34
+ return false;
35
+ try {
36
+ return metaUrl === pathToFileURL(realpathSync(argv1)).href;
37
+ }
38
+ catch {
39
+ return metaUrl === pathToFileURL(resolve(argv1)).href;
40
+ }
33
41
  }
34
42
  /* v8 ignore next 3 */
35
43
  if (isMainModule(import.meta.url, process.argv[1])) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vouchington-tooling",
3
- "version": "0.0.0",
3
+ "version": "0.0.2",
4
4
  "description": "Vouchington CLI and extractable tooling libraries.",
5
5
  "homepage": "https://github.com/vouchington/vouchington-tooling/tree/main/packages/vouchington-tooling#readme",
6
6
  "bugs": {