Skip to content
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

asdf plugin list should return a 0 exit code when no plugins are installed #903

Closed
benfiola opened this issue Mar 21, 2021 · 4 comments · Fixed by #1597
Closed

asdf plugin list should return a 0 exit code when no plugins are installed #903

benfiola opened this issue Mar 21, 2021 · 4 comments · Fixed by #1597

Comments

@benfiola
Copy link

I'm using ansible to bootstrap a development environment. Part of this process is installing asdf along with some plugins. Prior to installing a plugin, I run asdf plugin list to see if that plugin is already installed. When no plugins are installed, asdf plugin list will return a non-zero exit code - which ansible recognizes as a failure. To me, having no plugins and attempting to list all installed plugins should just return an empty list - not a failure code.

It's not a big deal though - the workaround I'm doing is:

  - name: get asdf plugin list
    command: 
      cmd: "asdf plugin list"
    register: asdf_plugin_list
    failed_when: asdf_plugin_list.rc != 0 and 'No plugins installed' not in asdf_plugin_list.stderr

Buuut, I wouldn't mind throwing up a PR to address this if you're willing!

@jthegedus
Copy link
Contributor

We have many people requesting many different behaviours of errors and exit codes. For greater context, can you find the original PR/issue that introduced this so we can capture the history of the decision before we consider a change?

@benfiola
Copy link
Author

benfiola commented Mar 23, 2021

Sure! Here's the originating PR:

#273

@jthegedus
Copy link
Contributor

Lol, it was me! Since this isn't technically an error in the tool, I am happy for this to be changed to exit 0 and to not use display_error, but rather just print the information with printf to the user.

@benfiola
Copy link
Author

benfiola commented Apr 3, 2021

Sure! I can throw up a PR. Thanks for getting back to me!

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 a pull request may close this issue.

2 participants