when xargo is manually specified, don't try to upgrade it

This commit is contained in:
Ralf Jung 2019-10-21 10:25:47 +02:00
parent fccb239824
commit ebdb6d4df7

View File

@ -259,6 +259,10 @@ fn setup(ask_user: bool) {
// First, we need xargo.
if xargo_version().map_or(true, |v| v < (0, 3, 16)) {
if std::env::var("XARGO").is_ok() {
// The user manually gave us a xargo binary; don't do anything automatically.
show_error(format!("Your xargo is too old; please upgrade to the latest version"))
}
let mut cmd = cargo();
cmd.args(&["install", "xargo", "-f"]);
ask_to_run(cmd, ask_user, "install a recent enough xargo");