Skip to content

Commit

Permalink
Merge pull request #621 from inejge/active-custom
Browse files Browse the repository at this point in the history
Handle active custom toolchain in "show"
  • Loading branch information
brson authored Jul 29, 2016
2 parents 87890db + 9aacd71 commit c2ebdf3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/rustup-cli/rustup_mode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -453,11 +453,14 @@ fn show(cfg: &Cfg) -> Result<()> {
let installed_toolchains = try!(cfg.list_toolchains());
let active_toolchain = try!(cfg.find_override_toolchain_or_default(cwd));
let active_targets = if let Some((ref t, _)) = active_toolchain {
try!(t.list_components())
.into_iter()
.filter(|c| c.component.pkg == "rust-std")
.filter(|c| c.installed)
.collect()
match t.list_components() {
Ok(cs_vec) => cs_vec
.into_iter()
.filter(|c| c.component.pkg == "rust-std")
.filter(|c| c.installed)
.collect(),
Err(_) => vec![]
}
} else {
vec![]
};
Expand Down
2 changes: 2 additions & 0 deletions tests/cli-rustup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,8 @@ fn link() {
expect_ok(config, &["rustup", "default", "custom"]);
expect_stdout_ok(config, &["rustc", "--version"],
"hash-c-1");
expect_stdout_ok(config, &["rustup", "show"],
"custom (default)");
expect_ok(config, &["rustup", "update", "nightly"]);
expect_ok(config, &["rustup", "default", "nightly"]);
expect_stdout_ok(config, &["rustup", "show"],
Expand Down

0 comments on commit c2ebdf3

Please sign in to comment.