Skip to content

Commit

Permalink
Print rustup version after update
Browse files Browse the repository at this point in the history
  • Loading branch information
julienXX committed Jul 25, 2016
1 parent 7f311dd commit b35bb04
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
4 changes: 3 additions & 1 deletion src/rustup-cli/self_update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ pub const NEVER_SELF_UPDATE: bool = true;
#[cfg(not(feature = "no-self-update"))]
pub const NEVER_SELF_UPDATE: bool = false;

pub const VERSION: &'static str = env!("CARGO_PKG_VERSION");

// The big installation messages. These are macros because the first
// argument of format! needs to be a literal.

Expand Down Expand Up @@ -1069,7 +1071,7 @@ pub fn update() -> Result<()> {
}
let setup_path = try!(prepare_update());
if let Some(ref p) = setup_path {
info!("rustup updated successfully");
info!("rustup updated successfully to {}", VERSION);
try!(run_update(p));
}

Expand Down
13 changes: 8 additions & 5 deletions tests/cli-self-upd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -456,14 +456,17 @@ fn install_doesnt_modify_path_if_passed_no_modify_path() {

#[test]
fn update_exact() {
update_setup(&|config, _| {
expect_ok(config, &["rustup-init", "-y"]);
expect_ok_ex(config, &["rustup", "self", "update"],
r"",
let version = env!("CARGO_PKG_VERSION");
let expected_output = &(
r"info: checking for self-updates
info: downloading self-update
info: rustup updated successfully
info: rustup updated successfully to ".to_owned() + version + "
");

update_setup(&|config, _| {
expect_ok(config, &["rustup-init", "-y"]);
expect_ok_ex(config, &["rustup", "self", "update"],
r"", expected_output)
});
}

Expand Down

0 comments on commit b35bb04

Please sign in to comment.