Skip to content

Commit

Permalink
Merge pull request #707 from rjgoldsborough/prepend-cargo-bin-to-path
Browse files Browse the repository at this point in the history
making rustup prepend cargo bin to path instead of append
  • Loading branch information
brson authored Sep 3, 2016
2 parents e82a935 + 7143e74 commit f5cd405
Showing 1 changed file with 5 additions and 5 deletions.
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

0 comments on commit f5cd405

Please sign in to comment.