offsite 0.0.39 → 0.0.40

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.
@@ -3436,6 +3436,32 @@ var Alerts = class {
3436
3436
  }
3437
3437
  };
3438
3438
  //#endregion
3439
+ //#region src/services/terminal/find-program.ts
3440
+ const found = /* @__PURE__ */ new Map();
3441
+ function findWindowsProgram(command) {
3442
+ if (/[\\/]/.test(command)) return command;
3443
+ const cached = found.get(command);
3444
+ if (cached !== void 0) return cached;
3445
+ const extensions = path.extname(command) === "" ? (process.env.PATHEXT ?? ".COM;.EXE;.BAT;.CMD").split(";") : [""];
3446
+ for (const directory of (process.env.PATH ?? "").split(path.delimiter)) {
3447
+ if (directory === "") continue;
3448
+ for (const extension of extensions) {
3449
+ const candidate = path.join(directory, command + extension);
3450
+ let entry;
3451
+ try {
3452
+ entry = lstatSync(candidate, { throwIfNoEntry: false });
3453
+ } catch {
3454
+ continue;
3455
+ }
3456
+ if (entry !== void 0 && !entry.isDirectory()) {
3457
+ found.set(command, candidate);
3458
+ return candidate;
3459
+ }
3460
+ }
3461
+ }
3462
+ throw new Error(`could not find ${command} in PATH`);
3463
+ }
3464
+ //#endregion
3439
3465
  //#region ../core/src/shell-check.ts
3440
3466
  function zshOptionsSupported(options) {
3441
3467
  for (let position = 0; position < options.length; position++) {
@@ -3641,7 +3667,7 @@ function startShell(cwd) {
3641
3667
  let args;
3642
3668
  if (process.platform === "win32") {
3643
3669
  Object.assign(env, process.env);
3644
- file = options.command ?? defaultShell();
3670
+ file = findWindowsProgram(options.command ?? defaultShell());
3645
3671
  args = [];
3646
3672
  } else {
3647
3673
  for (const name of [