cli: set I/O stream to Stdio:null if the given solana_version is already installed#2757
Conversation
|
@simplysabir is attempting to deploy a commit to the coral-xyz Team on Vercel. A member of the Team first needs to authorize it. |
acheroncrypto
left a comment
There was a problem hiding this comment.
Thank you for your interest in contributing to Anchor!
This implementation doesn't currently solve the issue described in #2724 because the installation progress is still not visible.
So i Should do this right?
am i right on this approach? |
Yes, the I/O behavior should change based on whether the version is already installed. |
Added another implementation kindly have a look. |
acheroncrypto
left a comment
There was a problem hiding this comment.
These comments don't add any context to what's being done, please remove them.
|
@acheroncrypto Removed comments and updated the fn is_solana_version_installed(version: &str) -> Result<bool> {
let output = std::process::Command::new("ls")
.arg("-l")
.arg("~/.local/share/solana/install/releases")
.output()?;
if output.status.success() {
let output_versions = std::str::from_utf8(&output.stdout)?;
Ok(output_versions.lines().any(|line| line.contains(version)))
} else {
Err(anyhow!("Failed to list Solana installed versions"))
}
} |
acheroncrypto
left a comment
There was a problem hiding this comment.
Looks great but I've changed ls command to solana-install list to make it simpler and OS agnostic.
Thank you for contributing!
…already installed (otter-sec#2757) Co-authored-by: acheron <acheroncrypto@gmail.com>
Description :
solana_versionis not installed in CLI #2724