Skip to content

Commit

Permalink
Fix an incorrect comparison in impl Zsh
Browse files Browse the repository at this point in the history
  • Loading branch information
workingjubilee committed Jul 17, 2020
1 parent e45a1ec commit c10b410
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/cli/self_update/shell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ impl UnixShell for Bash {
}

fn rcfiles(&self) -> Vec<PathBuf> {
[".bash_profile", ".bash_login", ".profile", ".bashrc"]
[".bash_profile", ".bash_login", ".bashrc"]
.iter()
.filter_map(|rc| utils::home_dir().map(|dir| dir.join(rc)))
.collect()
Expand All @@ -153,16 +153,14 @@ impl Zsh {
Ok(dir) if dir.len() > 0 => Ok(PathBuf::from(dir)),
_ => bail!("Zsh setup failed."),
}
} else if utils::find_cmd(&["zsh"]) == Some("zsh") {
} else {
match std::process::Command::new("zsh")
.args(&["-c", "'echo $ZDOTDIR'"])
.output()
{
Ok(io) if io.stdout.len() > 0 => Ok(PathBuf::from(OsStr::from_bytes(&io.stdout))),
_ => bail!("Zsh setup failed."),
}
} else {
bail!("What? Unpossible.")
}
}
}
Expand Down

0 comments on commit c10b410

Please sign in to comment.