mirror of
https://github.com/nushell/nushell.git
synced 2025-07-01 07:00:37 +02:00
Removes export env
command (#6468)
* remove export_env command * remove several export env usage in test code * adjust hiding relative test case * fix clippy * adjust tests * update tests * unignore these tests to expose ut failed * using `use` instead of `overlay use` in some tests * Revert "using `use` instead of `overlay use` in some tests" This reverts commit2ae24b24c3
. * Revert "adjust hiding relative test case" This reverts commit4369af6d05
. * Bring back module example * Revert "update tests" This reverts commit6ae94ef513
. * Fix tests * "Fix" a test * Remove remaining deprecated env functionality * Re-enable environment hiding for `hide` To not break virtualenv since the overlay update is not merged yet * Fix hiding env in `hide` and ignore some tests Co-authored-by: kubouch <kubouch@gmail.com>
This commit is contained in:
@ -178,39 +178,6 @@ impl Stack {
|
||||
result
|
||||
}
|
||||
|
||||
/// Flatten the env var scope frames into one frame, only from one overlay
|
||||
pub fn get_overlay_env_vars(
|
||||
&self,
|
||||
engine_state: &EngineState,
|
||||
overlay_name: &str,
|
||||
) -> HashMap<String, Value> {
|
||||
let mut result = HashMap::new();
|
||||
|
||||
// for active_overlay in self.active_overlays.iter() {
|
||||
if let Some(active_overlay) = self.active_overlays.iter().find(|n| n == &overlay_name) {
|
||||
if let Some(env_vars) = engine_state.env_vars.get(active_overlay) {
|
||||
result.extend(
|
||||
env_vars
|
||||
.iter()
|
||||
.filter(|(k, _)| {
|
||||
if let Some(env_hidden) = self.env_hidden.get(active_overlay) {
|
||||
!env_hidden.contains(*k)
|
||||
} else {
|
||||
// nothing has been hidden in this overlay
|
||||
true
|
||||
}
|
||||
})
|
||||
.map(|(k, v)| (k.clone(), v.clone()))
|
||||
.collect::<HashMap<String, Value>>(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
result.extend(self.get_stack_overlay_env_vars(overlay_name));
|
||||
|
||||
result
|
||||
}
|
||||
|
||||
/// Get flattened environment variables only from the stack
|
||||
pub fn get_stack_env_vars(&self) -> HashMap<String, Value> {
|
||||
let mut result = HashMap::new();
|
||||
|
Reference in New Issue
Block a user