Add --eval flag to solana-install info

This commit is contained in:
Michael Vines
2020-10-20 12:09:12 -07:00
committed by mergify[bot]
parent f71677164f
commit 6f930351d2
2 changed files with 21 additions and 3 deletions

View File

@@ -568,9 +568,21 @@ fn release_channel_version_url(release_channel: &str) -> String {
)
}
pub fn info(config_file: &str, local_info_only: bool) -> Result<Option<UpdateManifest>, String> {
pub fn info(
config_file: &str,
local_info_only: bool,
eval: bool,
) -> Result<Option<UpdateManifest>, String> {
let config = Config::load(config_file)?;
if eval {
println!(
"SOLANA_INSTALL_ACTIVE_RELEASE={}",
&config.active_release_dir().to_str().unwrap_or("")
);
return Ok(None);
}
println_name_value("Configuration:", &config_file);
println_name_value(
"Active release directory:",
@@ -753,7 +765,7 @@ fn symlink_dir<P: AsRef<Path>, Q: AsRef<Path>>(src: P, dst: Q) -> std::io::Resul
pub fn update(config_file: &str) -> Result<bool, String> {
let mut config = Config::load(config_file)?;
let update_manifest = info(config_file, false)?;
let update_manifest = info(config_file, false, false)?;
let release_dir = if let Some(explicit_release) = &config.explicit_release {
let (download_url, release_dir) = match explicit_release {