Don't insert PATH variable on Windows (#3422)

* Don't insert PATH variable on Windows

* Simplify fix

* Just centralize the var

* Add a message about why we have to workaround the issue
This commit is contained in:
JT
2021-05-13 15:03:49 +12:00
committed by GitHub
parent 874ecd6c88
commit 9b8b1bad57
10 changed files with 42 additions and 25 deletions

View File

@ -3,6 +3,7 @@ use indexmap::IndexMap;
use nu_errors::ShellError;
use nu_protocol::Value;
use nu_source::Tag;
use nu_test_support::NATIVE_PATH_ENV_VAR;
use std::{fmt::Debug, path::PathBuf};
use super::write;
@ -147,7 +148,7 @@ impl NuConfig {
pub fn path(&self) -> Result<Option<Vec<PathBuf>>, ShellError> {
let vars = &self.vars;
if let Some(path) = vars.get("path").or_else(|| vars.get("PATH")) {
if let Some(path) = vars.get("path").or_else(|| vars.get(NATIVE_PATH_ENV_VAR)) {
path
.table_entries()
.map(|p| {