Closed austinfrey closed 7 years ago
Hi @brikis98 , so my little if statement returns latestTag
which, up until this point in the program has not been assigned since no matching tags have been found. An error is thrown and handled after the getLatestAcceptableTag
function returns to the main function with an empty latestTag value. I can add an error here, though, if you'd like. Would return latestTag, wrapError(errors.New("Tag does not exist"))
be OK?
before the change
fetch --tag="~>v0.0.4" --repo https://github.com/gruntwork-io/fetch-test-public ~/tag-test
>Downloading tag "v0.0.1" of https://github.com/gruntwork-io/fetch-test-public ...
>Extracting files from <repo>/ to /home/austin/tag-test ...
>Download and file extraction complete.
after the change
fetch --tag="~>v0.0.4" --repo https://github.com/gruntwork-io/fetch-test-public ~/tag-test
ERROR: The commit sha, tag, and branch name are all empty.
Ah, gotcha. Yea, please return a custom error message so it's clear what happened. "The commit sha, tag, and branch name are all empty" is not accurate and will confuse users. Once that and the automated test are added, this will be ready to go!
Sounds good!
test added
closing to resubmit as one commit
Sounds good!
this should fix issue #6 where the
~>
operator finds an acceptable tag on what should be an unavailable tag.