mirror of https://github.com/jdx/mise
chore: switch from home -> homedir crate (#3743)
home is apparently not to be used outside of cargo
This commit is contained in:
parent
4727339de1
commit
1f0c01b0ec
|
@ -2631,7 +2631,7 @@ dependencies = [
|
|||
"glob",
|
||||
"globset",
|
||||
"heck 0.5.0",
|
||||
"home",
|
||||
"homedir",
|
||||
"humantime",
|
||||
"indenter",
|
||||
"indexmap 2.7.0",
|
||||
|
|
|
@ -68,6 +68,7 @@ digest = "0.10.7"
|
|||
dotenvy = "0.15"
|
||||
duct = "0.13"
|
||||
either = { version = "1", features = ["serde"] }
|
||||
homedir = "0.3"
|
||||
# expr-lang = { path = "../expr-lang" }
|
||||
expr-lang = "0.2"
|
||||
eyre = "0.6"
|
||||
|
@ -78,7 +79,6 @@ git2 = "<1"
|
|||
glob = "0.3"
|
||||
globset = "0.4"
|
||||
heck = "0.5"
|
||||
home = "0.5"
|
||||
humantime = "2"
|
||||
indenter = "0.3"
|
||||
indexmap = { version = "2", features = ["serde"] }
|
||||
|
|
|
@ -23,8 +23,12 @@ pub static SHELL: Lazy<String> = Lazy::new(|| var("COMSPEC").unwrap_or_else(|_|
|
|||
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 HOME: Lazy<PathBuf> = Lazy::new(|| {
|
||||
homedir::my_home()
|
||||
.ok()
|
||||
.flatten()
|
||||
.unwrap_or_else(|| PathBuf::from("/"))
|
||||
});
|
||||
|
||||
pub static EDITOR: Lazy<String> =
|
||||
Lazy::new(|| var("VISUAL").unwrap_or_else(|_| var("EDITOR").unwrap_or_else(|_| "nano".into())));
|
||||
|
|
Loading…
Reference in New Issue