When setting systemd environment, chain user PATH with preexisting one
This commit is contained in:
parent
935e553a35
commit
484e4f62d4
1 changed files with 20 additions and 16 deletions
|
@ -155,6 +155,10 @@ fn set_environment() -> Environment {
|
||||||
if let Some((variable, value)) = var.split_once("=") {
|
if let Some((variable, value)) = var.split_once("=") {
|
||||||
if let Err(env::VarError::NotPresent) = env::var(variable) {
|
if let Err(env::VarError::NotPresent) = env::var(variable) {
|
||||||
env::set_var(variable, value);
|
env::set_var(variable, value);
|
||||||
|
} else if variable == "PATH" {
|
||||||
|
let current_path = env::var("PATH").unwrap();
|
||||||
|
let chained_path = format!("{}:{}", value, current_path);
|
||||||
|
env::set_var("PATH", chained_path);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue