@mkterswingman/5mghost-twinkler 0.1.0 → 0.1.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.
Files changed (2) hide show
  1. package/dist/cli.js +12 -2
  2. package/package.json +2 -2
package/dist/cli.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { readFileSync } from "node:fs";
2
+ import { readFileSync, realpathSync } from "node:fs";
3
3
  import { dirname, join } from "node:path";
4
4
  import { fileURLToPath } from "node:url";
5
5
  import { getAuthStatus, logout, PAT_LOGIN_URL, savePat } from "./auth.js";
@@ -208,7 +208,17 @@ function readPackageVersion() {
208
208
  }
209
209
  return "0.0.0";
210
210
  }
211
- if (import.meta.url === `file://${process.argv[1]}`) {
211
+ function isDirectCliEntrypoint() {
212
+ if (!process.argv[1])
213
+ return false;
214
+ try {
215
+ return realpathSync(fileURLToPath(import.meta.url)) === realpathSync(process.argv[1]);
216
+ }
217
+ catch {
218
+ return import.meta.url === `file://${process.argv[1]}`;
219
+ }
220
+ }
221
+ if (isDirectCliEntrypoint()) {
212
222
  runCli().then((code) => {
213
223
  process.exitCode = code;
214
224
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mkterswingman/5mghost-twinkler",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Lightweight AI helper for the 5mghost Twinkler API",
5
5
  "type": "module",
6
6
  "engines": {
@@ -10,7 +10,7 @@
10
10
  "access": "public"
11
11
  },
12
12
  "bin": {
13
- "twinkler": "./dist/cli.js"
13
+ "twinkler": "dist/cli.js"
14
14
  },
15
15
  "exports": {
16
16
  ".": {