Print on missing version and return (#1412)

This commit is contained in:
Tom Linton 2022-02-09 12:32:48 +13:00 committed by GitHub
parent 6d3a7e54ec
commit 152658bfae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 1 deletions

View File

@ -55,11 +55,17 @@ pub fn use_version(version: &Version) -> Result<()> {
"anchor-cli {} is not installed, would you like to install it? (y/n)",
version
))
.with_initial_text("y")
.default("n".into())
.interact_text()?;
if matches!(input.as_str(), "y" | "yy" | "Y" | "yes" | "Yes") {
install_version(version)?;
} else {
println!(
"Version {} is not installed, staying on version {}.",
version,
current_version()?
);
return Ok(());
}
}