Skip to content

Commit

Permalink
zsh support
Browse files Browse the repository at this point in the history
add path to .profile and if zsh then .zprofile too.
  • Loading branch information
polonez committed Mar 27, 2017
1 parent 073e6e7 commit cd17377
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/rustup-cli/self_update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -978,15 +978,12 @@ fn get_add_path_methods() -> Vec<PathUpdateMethod> {
return vec![PathUpdateMethod::Windows];
}

let profile_name = ".profile";

let profile = utils::home_dir().map(|p| p.join(profile_name));
let profile = utils::home_dir().map(|p| p.join(".profile"));
let mut profiles = vec![profile];

if let Ok(shell) = env::var("SHELL") {
if shell.contains("zsh") {
let zprofile_name = ".zprofile";
let zprofile = utils::home_dir().map(|p| p.join(zprofile_name));
let zprofile = utils::home_dir().map(|p| p.join(".zprofile"));
profiles.push(zprofile);
}
}
Expand Down

0 comments on commit cd17377

Please sign in to comment.