tfenv
tfenv copied to clipboard
fix: filter out Artifactory version & sort versions
fix #400 #401
@Zordrak any chance that this PR can be reviewed? We're also running into issue #400, and this PR looks to resolve it.
We running into the same issue, would it be possible to merge this?
The p flag for the s command of sed is meant to display the changed line, it doesn't seem possible to exclude the artifactory line and retrieve the version on other line in one command. So if you want to do it with one sed call, you should use two commands :
sed -En -e 's#.*[A-Za-z]+/([0-9]+\.[0-9]+\.[0-9]+(-(rc|beta|alpha|oci)-?[0-9]*)?).*##' -e 's#.*([0-9]+\.[0-9]+\.[0-9]+(-(rc|beta|alpha|oci)-?[0-9]*)?).*#\1#p'
That did not remove duplicates, and i am not sure that will be more readable than the use of two grep calls.
Changing the showed line 77 in the PR with grep -v -E "[A-Za-z]+/[0-9]+\.[0-9]+\.[0-9]+
wouldn't be enough to make it more generic ?
the errors seems to be linked to https://github.com/golang/go/issues/49425
the first go version without this bug is the 1.11, the first terraform release with 1.11+ compatibility instead of 1.10+ is the 0.11.9, i will upgrade the tests accordingly