Skip to content

Commit

Permalink
Auto merge of #1013 - polonez:feature/zsh-support, r=Diggsey
Browse files Browse the repository at this point in the history
zsh install support

- add path to .zprofile
- add a test for zsh
  • Loading branch information
bors committed Apr 1, 2017
2 parents c18094e + 9a9abe1 commit 68848c9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/rustup-cli/self_update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -977,8 +977,16 @@ fn get_add_path_methods() -> Vec<PathUpdateMethod> {
}

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

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

let rcfiles = profiles.into_iter().filter_map(|f|f);
rcfiles.map(PathUpdateMethod::RcFile).collect()
}

Expand Down
1 change: 1 addition & 0 deletions src/rustup-mock/src/clitools.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ pub static MULTI_ARCH1: &'static str = "i686-unknown-linux-gnu";
pub fn setup(s: Scenario, f: &Fn(&Config)) {
// Unset env variables that will break our testing
env::remove_var("RUSTUP_TOOLCHAIN");
env::remove_var("SHELL");

let exedir = TempDir::new("rustup-exe").unwrap();
let distdir = TempDir::new("rustup-dist").unwrap();
Expand Down

0 comments on commit 68848c9

Please sign in to comment.