Skip to content

Commit c6eeef5

Browse files
authored
Merge pull request #18 from Zeegomo/install-upgrade
use cargo install to update binaries
2 parents b6a8893 + 9591f75 commit c6eeef5

File tree

2 files changed

+1
-28
lines changed

2 files changed

+1
-28
lines changed

src/tools/binary_crates.rs

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -58,25 +58,7 @@ impl Tool for BinaryCrate {
5858
Ok(())
5959
}
6060

61-
#[cfg(not(feature = "unstable"))]
62-
fn update(&self, workspace: &Workspace, _fast_install: bool) -> Result<(), Error> {
63-
Command::new(workspace, &crate::tools::CARGO_INSTALL_UPDATE)
64-
.args(&[self.crate_name])
65-
.timeout(None)
66-
.run()?;
67-
Ok(())
68-
}
69-
70-
#[cfg(feature = "unstable")]
7161
fn update(&self, workspace: &Workspace, fast_install: bool) -> Result<(), Error> {
72-
let mut cmd = Command::new(workspace, &Toolchain::MAIN.cargo())
73-
.args(&["-Zinstall-upgrade", "install", self.crate_name])
74-
.env("__CARGO_TEST_CHANNEL_OVERRIDE_DO_NOT_USE_THIS", "nightly")
75-
.timeout(None);
76-
if fast_install {
77-
cmd = cmd.args(&["--debug"]);
78-
}
79-
cmd.run()?;
80-
Ok(())
62+
self.install(workspace, fast_install)
8163
}
8264
}

src/tools/mod.rs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,6 @@ use std::path::PathBuf;
1111

1212
pub(crate) static RUSTUP: Rustup = Rustup;
1313

14-
#[cfg(not(feature = "unstable"))]
15-
pub(crate) static CARGO_INSTALL_UPDATE: BinaryCrate = BinaryCrate {
16-
crate_name: "cargo-update",
17-
binary: "cargo-install-update",
18-
cargo_subcommand: Some("install-update"),
19-
};
20-
2114
pub(crate) static RUSTUP_TOOLCHAIN_INSTALL_MASTER: BinaryCrate = BinaryCrate {
2215
crate_name: "rustup-toolchain-install-master",
2316
binary: "rustup-toolchain-install-master",
@@ -32,8 +25,6 @@ pub(crate) static GIT_CREDENTIAL_NULL: BinaryCrate = BinaryCrate {
3225

3326
static INSTALLABLE_TOOLS: &[&dyn Tool] = &[
3427
&RUSTUP,
35-
#[cfg(not(feature = "unstable"))]
36-
&CARGO_INSTALL_UPDATE,
3728
&RUSTUP_TOOLCHAIN_INSTALL_MASTER,
3829
&GIT_CREDENTIAL_NULL,
3930
];

0 commit comments

Comments
 (0)