pi-agent-browser-native 0.2.20 → 0.2.21
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/CHANGELOG.md +5 -0
- package/package.json +1 -1
- package/scripts/doctor.mjs +11 -1
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
package/scripts/doctor.mjs
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
import { execFile as execFileCallback } from "node:child_process";
|
|
11
|
+
import { realpathSync } from "node:fs";
|
|
11
12
|
import { access, readFile } from "node:fs/promises";
|
|
12
13
|
import { homedir } from "node:os";
|
|
13
14
|
import { dirname, resolve, sep } from "node:path";
|
|
@@ -415,7 +416,16 @@ export async function main(argv = process.argv.slice(2)) {
|
|
|
415
416
|
return 0;
|
|
416
417
|
}
|
|
417
418
|
|
|
418
|
-
|
|
419
|
+
export function isDirectRun(metaUrl, argv1 = process.argv[1], resolveRealPath = realpathSync) {
|
|
420
|
+
if (!argv1) return false;
|
|
421
|
+
try {
|
|
422
|
+
return resolveRealPath(argv1) === fileURLToPath(metaUrl);
|
|
423
|
+
} catch {
|
|
424
|
+
return false;
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
if (isDirectRun(import.meta.url)) {
|
|
419
429
|
main().then((exitCode) => {
|
|
420
430
|
process.exitCode = exitCode;
|
|
421
431
|
});
|