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

making rustup prepend cargo bin to path instead of append #707

Merged
merged 2 commits into from
Sep 3, 2016
Merged
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: 5 additions & 5 deletions src/rustup/toolchain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -321,13 +321,13 @@ impl<'a> Toolchain<'a> {
}
env_var::prepend_path(sysenv::LOADER_PATH, &new_path, cmd);

// Append first cargo_home, then toolchain/bin to the PATH
let mut path_to_append = Vec::with_capacity(2);
// Prepend first cargo_home, then toolchain/bin to the PATH
let mut path_to_prepend = PathBuf::from("");
if let Ok(cargo_home) = utils::cargo_home() {
path_to_append.push(cargo_home.join("bin"));
path_to_prepend.push(cargo_home.join("bin"));
}
path_to_append.push(self.path.join("bin"));
env_var::append_path("PATH", path_to_append, cmd);
path_to_prepend.push(self.path.join("bin"));
env_var::prepend_path("PATH", path_to_prepend.as_path(), cmd);
}

pub fn doc_path(&self, relative: &str) -> Result<PathBuf> {
Expand Down