From fb1839971a2cd0a82a72fdb52d8023a8d94aa777 Mon Sep 17 00:00:00 2001 From: Sam Hedin Date: Tue, 16 Jun 2020 19:20:04 +0200 Subject: [PATCH] Add TODO file --- crates/nu-cli/src/env/TODO.org | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 crates/nu-cli/src/env/TODO.org diff --git a/crates/nu-cli/src/env/TODO.org b/crates/nu-cli/src/env/TODO.org new file mode 100644 index 0000000000..1b42c89e7d --- /dev/null +++ b/crates/nu-cli/src/env/TODO.org @@ -0,0 +1,22 @@ +* TODO +** Run even if =env()= returns None +It happens if there is no env-section in .config/nu/config.toml. +This results in +#+begin_src rust +impl Env for Environment { + fn env(&self) -> Option { + if let Some(vars) = &self.environment_vars { + return Some(vars.clone()); + } + + None + } +#+end_src +returning =None=, which completely skips running the code for dealing with directory specific environment variables. +** Confirm intended behavior + - If you are in a directory, or a subdirectory to a directory with a .nu-file, the vars in that .nu-file are applied. + - If you leave a directory which set some variables, the variables are unset. + - If a directory contains a .nu with an environment variable that was already set, the old value will be overwritten. + - This holds even if the old value was set by a .nu in a parent directory. The overwritten value is restored when you leave the directory. +** Security + https://github.com/nushell/nushell/issues/1965 \ No newline at end of file