mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-08 10:51:15 -03:00
Re-use DEFAULT_PATH in setup_path
- No need to hard-code a different default
This commit is contained in:
committed by
Fabian Boehm
parent
008764a2cd
commit
676c3c9bc2
2
fish-rust/src/env/environment.rs
vendored
2
fish-rust/src/env/environment.rs
vendored
@@ -512,7 +512,7 @@ fn setup_path() {
|
||||
str2wcstring(cstr.to_bytes())
|
||||
} else {
|
||||
// the above should really not fail
|
||||
L!("/usr/bin:/bin").to_owned()
|
||||
join_strings(crate::path::DEFAULT_PATH.as_ref(), ':')
|
||||
};
|
||||
|
||||
vars.set_one(L!("PATH"), EnvMode::GLOBAL | EnvMode::EXPORT, path);
|
||||
|
||||
@@ -185,7 +185,7 @@ pub fn path_get_path(cmd: &wstr, vars: &dyn Environment) -> Option<WString> {
|
||||
|
||||
// PREFIX is defined at build time.
|
||||
#[widestrs]
|
||||
static DEFAULT_PATH: Lazy<[WString; 3]> = Lazy::new(|| {
|
||||
pub static DEFAULT_PATH: Lazy<[WString; 3]> = Lazy::new(|| {
|
||||
[
|
||||
// TODO This should use env!. The fallback is only to appease "cargo test" for now.
|
||||
WString::from_str(option_env!("PREFIX").unwrap_or("/usr/local")) + "/bin"L,
|
||||
|
||||
Reference in New Issue
Block a user