浏览代码

Print on missing version and return (#1412)

Tom Linton 3 年之前
父节点
当前提交
152658bfae
共有 1 个文件被更改,包括 7 次插入1 次删除
  1. 7 1
      avm/src/lib.rs

+ 7 - 1
avm/src/lib.rs

@@ -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(());
         }
     }