8000 avm: Handle empty .version file by tomlinton · Pull Request #1407 · solana-foundation/anchor · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

avm: Handle empty .version file #1407

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

tomlinton
Copy link
Contributor
  • Fix panic for avm list on empty .version file
  • If you run avm install <list> and the .version file is empty, write the installed version to it

Closes #1405

@armaniferrante armaniferrante merged commit afef73b into solana-foundation:master Feb 8, 2022
@@ -174,7 +179,7 @@ pub fn list_versions() -> Result<()> {
if installed_versions.contains(v) {
flags.push("installed");
}
if current_version().unwrap() == v.clone() {
if current_version().is_ok() && current_version().unwrap() == v.clone() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if current_version().is_ok() && current_version().unwrap() == v.clone() {
if matches!(current_version(), Ok(cv) if cv == *v) {

Version without unwrap 🙂

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

very nice! 👯

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

avm: running avm list results in panic
3 participants
0