Fix issue which saw versions resolved twice #1064
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
The version of a tool was being looked up twice - once prior to downloading and again post downloading. This was because GetUrl was being reached twice, initially to determine the download url and then again to determine whether the download was an archive.
This change introduces a new function which takes the download url and uses that to determine whether its an archive. This removes the additional round trip and the associated output. The new function is also covered by an additional test.
Motivation and Context
design/approved
by a maintainer (required)Fixes Version appears to be looked up twice #1063
How Has This Been Tested?
Functional before and after:
make e2e
Types of changes
Documentation
./arkade get --format markdown
./arkade install --help
Checklist:
git commit -s