@raegent/earshot 0.4.0 → 0.4.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.
- package/dist/main.js +16 -12
- package/dist/main.js.map +4 -4
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -18459,7 +18459,7 @@ class ShadowGit {
|
|
|
18459
18459
|
}
|
|
18460
18460
|
|
|
18461
18461
|
// packages/core/src/version.ts
|
|
18462
|
-
var VERSION = "0.4.
|
|
18462
|
+
var VERSION = "0.4.2";
|
|
18463
18463
|
|
|
18464
18464
|
// packages/core/src/session/repair.ts
|
|
18465
18465
|
var REPAIR_TEXT = "No result was recorded for this call: earshot exited before the tool finished. " + "The call may or may not have run, so treat its effect as unknown and check " + "the current state rather than assuming either outcome.";
|
|
@@ -23403,9 +23403,8 @@ import { spawnSync as spawnSync2 } from "node:child_process";
|
|
|
23403
23403
|
import { createHash as createHash4 } from "node:crypto";
|
|
23404
23404
|
import { existsSync as existsSync2, realpathSync } from "node:fs";
|
|
23405
23405
|
import { chmod, readdir as readdir8, rename as rename2, rm as rm2, writeFile as writeFile10 } from "node:fs/promises";
|
|
23406
|
-
import { basename as basename2, dirname as dirname9, join as join19
|
|
23406
|
+
import { basename as basename2, dirname as dirname9, join as join19 } from "node:path";
|
|
23407
23407
|
import { createInterface } from "node:readline/promises";
|
|
23408
|
-
import { fileURLToPath } from "node:url";
|
|
23409
23408
|
var PACKAGE = "@raegent/earshot";
|
|
23410
23409
|
var REPO = "rishabhguptajs/earshot";
|
|
23411
23410
|
var REGISTRY = `https://registry.npmjs.org/${PACKAGE.replace("/", "%2f")}/latest`;
|
|
@@ -23418,9 +23417,13 @@ var ASSETS = {
|
|
|
23418
23417
|
"linux-arm64": "earshot-linux-arm64",
|
|
23419
23418
|
"win32-x64": "earshot-windows-x64.exe"
|
|
23420
23419
|
};
|
|
23421
|
-
function modulePath(moduleUrl) {
|
|
23420
|
+
function modulePath(moduleUrl, platform7) {
|
|
23422
23421
|
try {
|
|
23423
|
-
|
|
23422
|
+
const parsed = new URL(moduleUrl);
|
|
23423
|
+
let path = decodeURIComponent(parsed.pathname);
|
|
23424
|
+
if (platform7 === "win32" && /^\/[a-z]:\//i.test(path))
|
|
23425
|
+
path = path.slice(1);
|
|
23426
|
+
return path;
|
|
23424
23427
|
} catch {
|
|
23425
23428
|
return moduleUrl;
|
|
23426
23429
|
}
|
|
@@ -23440,7 +23443,8 @@ function managerOf(dir) {
|
|
|
23440
23443
|
function detectInstall(options) {
|
|
23441
23444
|
const { execPath, moduleUrl, bunVersion, platform: platform7, arch } = options;
|
|
23442
23445
|
const realpath = options.realpath ?? ((path) => path);
|
|
23443
|
-
const file = modulePath(moduleUrl);
|
|
23446
|
+
const file = modulePath(moduleUrl, platform7);
|
|
23447
|
+
const portableFile = file.replaceAll("\\", "/");
|
|
23444
23448
|
if (BUNFS_MARKERS.some((marker3) => file.includes(marker3)) && bunVersion !== undefined) {
|
|
23445
23449
|
const asset = ASSETS[`${platform7}-${arch}`];
|
|
23446
23450
|
const target = realpath(execPath);
|
|
@@ -23453,11 +23457,11 @@ function detectInstall(options) {
|
|
|
23453
23457
|
}
|
|
23454
23458
|
return { kind: "binary", path: target, asset };
|
|
23455
23459
|
}
|
|
23456
|
-
const marker2 =
|
|
23457
|
-
const index = `${
|
|
23460
|
+
const marker2 = `/node_modules/${PACKAGE}/`;
|
|
23461
|
+
const index = `${portableFile}/`.indexOf(marker2);
|
|
23458
23462
|
if (index !== -1) {
|
|
23459
|
-
const packageDir =
|
|
23460
|
-
const tree = packageDir.slice(0, packageDir.indexOf(
|
|
23463
|
+
const packageDir = portableFile.slice(0, index + marker2.length - 1);
|
|
23464
|
+
const tree = packageDir.slice(0, packageDir.indexOf("/node_modules/"));
|
|
23461
23465
|
const isProjectRoot = options.isProjectRoot ?? (() => false);
|
|
23462
23466
|
return {
|
|
23463
23467
|
kind: "npm",
|
|
@@ -23466,7 +23470,7 @@ function detectInstall(options) {
|
|
|
23466
23470
|
local: isProjectRoot(tree)
|
|
23467
23471
|
};
|
|
23468
23472
|
}
|
|
23469
|
-
if (
|
|
23473
|
+
if (portableFile.includes("/packages/cli/") || portableFile.endsWith(".ts")) {
|
|
23470
23474
|
return { kind: "source", path: file, reason: "running from a source checkout" };
|
|
23471
23475
|
}
|
|
23472
23476
|
return { kind: "unknown", path: file, reason: `cannot tell how ${execPath} was installed` };
|
|
@@ -23842,5 +23846,5 @@ async function main(argv = process.argv.slice(2)) {
|
|
|
23842
23846
|
var code = await main();
|
|
23843
23847
|
process.exitCode = code;
|
|
23844
23848
|
|
|
23845
|
-
//# debugId=
|
|
23849
|
+
//# debugId=E975B3DDC741EB7E64756E2164756E21
|
|
23846
23850
|
//# sourceMappingURL=main.js.map
|