cloud-usage-token 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.
- package/dist/index.js +11 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -9,7 +9,7 @@ var __export = (target, all) => {
|
|
|
9
9
|
import { createServer } from "http";
|
|
10
10
|
import { randomUUID } from "crypto";
|
|
11
11
|
import { homedir as homedir5 } from "os";
|
|
12
|
-
import { existsSync, promises as fs6 } from "fs";
|
|
12
|
+
import { existsSync, realpathSync, promises as fs6 } from "fs";
|
|
13
13
|
import path7 from "path";
|
|
14
14
|
import { fileURLToPath } from "url";
|
|
15
15
|
import { execFile as execFile3 } from "child_process";
|
|
@@ -7447,7 +7447,16 @@ ${CLI_HELP}
|
|
|
7447
7447
|
process.exitCode = 1;
|
|
7448
7448
|
}
|
|
7449
7449
|
}
|
|
7450
|
-
|
|
7450
|
+
function isMainEntry() {
|
|
7451
|
+
const entry = process.argv[1];
|
|
7452
|
+
if (!entry) return false;
|
|
7453
|
+
try {
|
|
7454
|
+
return realpathSync(entry) === realpathSync(fileURLToPath(import.meta.url));
|
|
7455
|
+
} catch {
|
|
7456
|
+
return false;
|
|
7457
|
+
}
|
|
7458
|
+
}
|
|
7459
|
+
if (isMainEntry()) {
|
|
7451
7460
|
void runCli(process.argv.slice(2)).catch((error) => {
|
|
7452
7461
|
process.stderr.write(`${error instanceof Error ? error.message : String(error)}
|
|
7453
7462
|
`);
|
package/package.json
CHANGED