diff --git a/src/rustup-cli/self_update.rs b/src/rustup-cli/self_update.rs index e3abe8f550..e1553cbf08 100644 --- a/src/rustup-cli/self_update.rs +++ b/src/rustup-cli/self_update.rs @@ -979,8 +979,16 @@ fn get_add_path_methods() -> Vec { } 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() } diff --git a/src/rustup-mock/src/clitools.rs b/src/rustup-mock/src/clitools.rs index 6e6b5d5324..8e2f6d0c94 100644 --- a/src/rustup-mock/src/clitools.rs +++ b/src/rustup-mock/src/clitools.rs @@ -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();