Skip to content

Commit

Permalink
ksud: fix path env, close #775
Browse files Browse the repository at this point in the history
  • Loading branch information
tiann committed Jul 18, 2023
1 parent db5f77a commit 56d1456
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion userspace/ksud/src/ksu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ pub fn root_shell() -> Result<()> {
fn add_path_to_env(path: &str) -> Result<()> {
let mut paths =
env::var_os("PATH").map_or(Vec::new(), |val| env::split_paths(&val).collect::<Vec<_>>());
let new_path = PathBuf::from(path);
let new_path = PathBuf::from(path.trim_end_matches('/'));
paths.push(new_path);
let new_path_env = env::join_paths(paths)?;
env::set_var("PATH", new_path_env);
Expand Down

0 comments on commit 56d1456

Please sign in to comment.