diff --git a/crates/nu-cli/src/env/directory_specific_environment.rs b/crates/nu-cli/src/env/directory_specific_environment.rs index ced1c78f1d..711e69b2f4 100644 --- a/crates/nu-cli/src/env/directory_specific_environment.rs +++ b/crates/nu-cli/src/env/directory_specific_environment.rs @@ -1,14 +1,14 @@ use crate::commands::{self, autoenv::Trusted}; use commands::autoenv; -use indexmap::{IndexMap, IndexSet}; +use indexmap::{IndexMap}; +use std::io::Write; use nu_errors::ShellError; use sha2::{Digest, Sha256}; -use std::io::Write; + use std::{ ffi::OsString, fmt::Debug, - fs::OpenOptions, - path::{Path, PathBuf}, + path::{Path, PathBuf}, fs::OpenOptions, }; type EnvKey = String; @@ -69,7 +69,6 @@ impl DirectorySpecificEnvironment { if working_dir.cmp(&self.last_seen_directory) != std::cmp::Ordering::Greater { return Ok(vars_to_add); } - while working_dir != self.last_seen_directory { let wdirenv = working_dir.join(".nu-env"); if wdirenv.exists() { diff --git a/crates/nu-cli/src/env/environment.rs b/crates/nu-cli/src/env/environment.rs index d9b2d3ca92..863a9b4d12 100644 --- a/crates/nu-cli/src/env/environment.rs +++ b/crates/nu-cli/src/env/environment.rs @@ -4,8 +4,8 @@ use indexmap::{indexmap, IndexSet}; use nu_errors::ShellError; use nu_protocol::{UntaggedValue, Value}; use std::ffi::OsString; -use std::io::Write; -use std::{fmt::Debug, fs::OpenOptions}; + +use std::{fmt::Debug}; pub trait Env: Debug + Send { fn env(&self) -> Option; @@ -66,15 +66,6 @@ impl Environment { let cleanup = self.autoenv.cleanup_after_dir_exit()?; - // let mut file = OpenOptions::new() - // .write(true) - // .append(true) - // .create(true) - // .open("cleanup.txt") - // .unwrap( - // ); - - // write!(&mut file, "{:?}\n", cleanup).unwrap(); for (k, v) in cleanup { if let Some(v) = v { diff --git a/crates/nu-cli/src/env/environment_syncer.rs b/crates/nu-cli/src/env/environment_syncer.rs index 842fc49a78..fca11f85cc 100644 --- a/crates/nu-cli/src/env/environment_syncer.rs +++ b/crates/nu-cli/src/env/environment_syncer.rs @@ -1,10 +1,10 @@ use crate::context::Context; use crate::data::config::{Conf, NuConfig}; -use std::io::Write; + use crate::env::environment::{Env, Environment}; use nu_source::Text; use parking_lot::Mutex; -use std::{fs::OpenOptions, sync::Arc}; +use std::{sync::Arc}; pub struct EnvironmentSyncer { pub env: Arc>>,