Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zsh install support #1013

Merged
merged 4 commits into from
Apr 1, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/rustup-cli/self_update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -979,8 +979,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