Closed alex-shafer-1002 closed 6 months ago
Your script produces the exact same output when run against tfutils:master. There isn't anything wrong with the line you're changing; you're probably comparing against the latest released binary on brew
, which is based on the 3.0.0 label, where tfenv-install
looked like this.
(sorry if I'm being a bit defensive, I wrote the line that this PR replaces š )
Got it, yes this was against the current brew version, we just really need a new deploy I guess.
Your script produces the exact same output when run against tfutils:master. There isn't anything wrong with the line you're changing; you're probably comparing against the latest released binary on
brew
, which is based on the 3.0.0 label, wheretfenv-install
looked like this.(sorry if I'm being a bit defensive, I wrote the line that this PR replaces š )
I'm having trouble following you or understanding how these two lines could produce the same output. Can you point me at the code you're talking about if it's not this? https://github.com/tfutils/tfenv/blob/1ccfddb22005b34eacaf06a9c33f58f14e816ec9/libexec/tfenv-install#L127
I just opened #403 to try to fix the bugs in these regexes, but it looks like this PR fixes the behavior as well.
Current master (but not release 3.0.0) fixes the issue where arm64 is chosen instead of amd64 for versions < 1.0.2. But with the code I linked (and this PR changes), some versions > 1.0.2 use amd64 instead of arm64.
You're definitely right, I didn't use the start of line anchors and should have been stricter about what I was matching with the regexes. Apologies to Alex
Superseded by #403
This corrects the regex to choose amd64 for versions < 1.0.2
Tested as follows:
tfenv list-remote
to this script to test all current versions:libexec/tfenv-install
with noTFENV_ARCH
set in my environment and tested some relevant cases (note the arch in the download URL):