Skip to content

Commit

Permalink
Update subprocess.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
maciekstosio committed Jan 13, 2025
1 parent 92ddc70 commit db9b802
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/vscode-extension/src/utilities/subprocess.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import { Platform } from "./platform";

export type ChildProcess = ExecaChildProcess<string>;

const PRE_PATH_TOKEN = "{RNIDE_PRE_PATH}";

async function getPathEnv(appRoot: string) {
// We run an interactive shell session to make sure that tool managers (nvm,
// asdf, mise, etc.) are loaded and PATH is set correctly. Mise in
Expand All @@ -16,8 +18,8 @@ async function getPathEnv(appRoot: string) {

// Fish, bash, and zsh all support -i and -c flags.
const shellPath = process.env.SHELL ?? "/bin/zsh";
const { stdout: path } = await execa(shellPath, ["-i", "-c", `cd "${appRoot}" && echo "$PATH"`]);
return path.trim();
const { stdout: path } = await execa(shellPath, ["-i", "-c", `cd "${appRoot}" && echo "${PRE_PATH_TOKEN}$PATH"`]);
return path.split(PRE_PATH_TOKEN)[1].trim();
}

let pathEnv: string | undefined;
Expand Down

0 comments on commit db9b802

Please sign in to comment.