@raegent/earshot 0.4.0 → 0.4.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/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.0";
18462
+ var VERSION = "0.4.1";
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,7 +23403,7 @@ 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, sep as sep5 } from "node:path";
23406
+ import { basename as basename2, dirname as dirname9, join as join19 } from "node:path";
23407
23407
  import { createInterface } from "node:readline/promises";
23408
23408
  import { fileURLToPath } from "node:url";
23409
23409
  var PACKAGE = "@raegent/earshot";
@@ -23441,6 +23441,7 @@ function detectInstall(options) {
23441
23441
  const { execPath, moduleUrl, bunVersion, platform: platform7, arch } = options;
23442
23442
  const realpath = options.realpath ?? ((path) => path);
23443
23443
  const file = modulePath(moduleUrl);
23444
+ const portableFile = file.replaceAll("\\", "/");
23444
23445
  if (BUNFS_MARKERS.some((marker3) => file.includes(marker3)) && bunVersion !== undefined) {
23445
23446
  const asset = ASSETS[`${platform7}-${arch}`];
23446
23447
  const target = realpath(execPath);
@@ -23453,11 +23454,11 @@ function detectInstall(options) {
23453
23454
  }
23454
23455
  return { kind: "binary", path: target, asset };
23455
23456
  }
23456
- const marker2 = `${sep5}node_modules${sep5}${PACKAGE.split("/").join(sep5)}${sep5}`;
23457
- const index = `${file}${sep5}`.indexOf(marker2);
23457
+ const marker2 = `/node_modules/${PACKAGE}/`;
23458
+ const index = `${portableFile}/`.indexOf(marker2);
23458
23459
  if (index !== -1) {
23459
- const packageDir = file.slice(0, index + marker2.length - 1);
23460
- const tree = packageDir.slice(0, packageDir.indexOf(`${sep5}node_modules${sep5}`));
23460
+ const packageDir = portableFile.slice(0, index + marker2.length - 1);
23461
+ const tree = packageDir.slice(0, packageDir.indexOf("/node_modules/"));
23461
23462
  const isProjectRoot = options.isProjectRoot ?? (() => false);
23462
23463
  return {
23463
23464
  kind: "npm",
@@ -23466,7 +23467,7 @@ function detectInstall(options) {
23466
23467
  local: isProjectRoot(tree)
23467
23468
  };
23468
23469
  }
23469
- if (file.includes(`${sep5}packages${sep5}cli${sep5}`) || file.endsWith(".ts")) {
23470
+ if (portableFile.includes("/packages/cli/") || portableFile.endsWith(".ts")) {
23470
23471
  return { kind: "source", path: file, reason: "running from a source checkout" };
23471
23472
  }
23472
23473
  return { kind: "unknown", path: file, reason: `cannot tell how ${execPath} was installed` };
@@ -23842,5 +23843,5 @@ async function main(argv = process.argv.slice(2)) {
23842
23843
  var code = await main();
23843
23844
  process.exitCode = code;
23844
23845
 
23845
- //# debugId=BF0091864A65A6E164756E2164756E21
23846
+ //# debugId=B770EDB836524DE564756E2164756E21
23846
23847
  //# sourceMappingURL=main.js.map