Skip to content

Commit

Permalink
test: fix home directory for win tests (#2464)
Browse files Browse the repository at this point in the history
  • Loading branch information
jdx authored Aug 17, 2024
1 parent 1436686 commit 15fbf0c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,13 @@ pub static ARGS: RwLock<Vec<String>> = RwLock::new(vec![]);
pub static SHELL: Lazy<String> = Lazy::new(|| var("SHELL").unwrap_or_else(|_| "sh".into()));

// paths and directories
#[cfg(test)]
pub static HOME: Lazy<PathBuf> =
Lazy::new(|| PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("test"));
#[cfg(not(test))]
pub static HOME: Lazy<PathBuf> =
Lazy::new(|| home::home_dir().unwrap_or_else(|| PathBuf::from("/")));

pub static EDITOR: Lazy<String> =
Lazy::new(|| var("VISUAL").unwrap_or_else(|_| var("EDITOR").unwrap_or_else(|_| "nano".into())));

Expand Down

0 comments on commit 15fbf0c

Please sign in to comment.