mirror of
https://github.com/openai/codex.git
synced 2026-11-13 22:47:20 +00:00
Fix Windows doctor npm root probe (#22967)
## Why On Windows npm-managed installs expose the working shim as `npm.cmd`. `codex doctor` probed bare `npm`, which could incorrectly report that npm global-root inspection was unavailable even when the install was healthy. Fixes #22964. ## What changed - Use `npm.cmd` for the doctor npm-root probe on Windows. - Keep the existing `npm` probe on non-Windows platforms.
This commit is contained in:
1 parent
326e31ab65
commit
de9c5c0226
1 file changed
+5
-1
@@ -105,6 +105,10 @@ const COLOR_ENV_VARS: &[&str] = &[
|
|||||||
const TERMINAL_DIMENSION_ENV_VARS: &[&str] = &["COLUMNS", "LINES"];
|
const TERMINAL_DIMENSION_ENV_VARS: &[&str] = &["COLUMNS", "LINES"];
|
||||||
const TERMINFO_ENV_VARS: &[&str] = &["TERMINFO", "TERMINFO_DIRS"];
|
const TERMINFO_ENV_VARS: &[&str] = &["TERMINFO", "TERMINFO_DIRS"];
|
||||||
const LOCALE_ENV_VARS: &[&str] = &["LC_ALL", "LC_CTYPE", "LANG"];
|
const LOCALE_ENV_VARS: &[&str] = &["LC_ALL", "LC_CTYPE", "LANG"];
|
||||||
|
#[cfg(windows)]
|
||||||
|
const NPM_COMMAND: &str = "npm.cmd";
|
||||||
|
#[cfg(not(windows))]
|
||||||
|
const NPM_COMMAND: &str = "npm";
|
||||||
const REMOTE_TERMINAL_ENV_VARS: &[&str] = &[
|
const REMOTE_TERMINAL_ENV_VARS: &[&str] = &[
|
||||||
"SSH_TTY",
|
"SSH_TTY",
|
||||||
"SSH_CONNECTION",
|
"SSH_CONNECTION",
|
||||||
@@ -884,7 +888,7 @@ fn npm_global_root_check() -> NpmRootCheck {
|
|||||||
return NpmRootCheck::MissingPackageRoot;
|
return NpmRootCheck::MissingPackageRoot;
|
||||||
};
|
};
|
||||||
|
|
||||||
let output = match run_command("npm", ["root", "-g"]) {
|
let output = match run_command(NPM_COMMAND, ["root", "-g"]) {
|
||||||
Ok(output) => output,
|
Ok(output) => output,
|
||||||
Err(err) => return NpmRootCheck::NpmUnavailable(err),
|
Err(err) => return NpmRootCheck::NpmUnavailable(err),
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in new issue
Block a user