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

feat: improve install error when app doesnt exist #1140

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rgee0
Copy link
Contributor

@rgee0 rgee0 commented Nov 21, 2024

Description

When trying to install an app that doesnt exist the error message would advise the user that the app doesnt exist and that they should run install --help to see what is available.

However, there may be situations where the user is using the wrong verb because they are trying to get a tool, rather than an app. This change introduces a check when an app not found error is encountered to see whether a tool with the user provided name exists and advises them accordingly.

also adds associated test.

Motivation and Context

  • I have raised an issue to propose this change, which has been given a label of design/approved by a maintainer (required)
    discussed on the community call on 20/11

How Has This Been Tested?

Functional

Tried the helm example with isnt an app but will resolve to a tool. Then tried burt which is neither app nor tool.

➜  arkade git:(addGetPrompt) make build                                                         
go build
➜  arkade git:(addGetPrompt) ./arkade install helm                                              
Error: no such app. helm is available as a tool, run "arkade get helm" to get it
➜  arkade git:(addGetPrompt) ./arkade install burt                                              
Error: no such app: burt, run "arkade install --help" for a list of apps

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Documentation

  • I have updated the list of tools in README.md if (required) with ./arkade get --format markdown
  • I have updated the list of apps in README.md if (required) with ./arkade install --help

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I've read the CONTRIBUTION guide
  • I have signed-off my commits with git commit -s
  • I have tested this on arm, or have added code to prevent deployment

When trying to install an app that doesnt exist the error message
would advise the user that the app doesnt exist and that they should
run `install --help` to see what is available.

However, there may be situations where the user is using the wrong verb
because they are trying to get a tool, rather than an app.  This change introduces
a check when an app not found error is encountered to see whether a tool with the
user provided name exists and advises them accordingly.

also adds associated test.

Signed-off-by: Richard Gee <[email protected]>
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.

1 participant