Skip to content

Commit 8625424

Browse files
authored
Update tfenv-version-name
Make tfenv-version-name respect the same regex for the latest keyword on its own as tfenv-resolve-version
1 parent bbac1ca commit 8625424

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

libexec/tfenv-version-name

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ if [[ "${TFENV_VERSION}" =~ ^latest.*$ ]]; then
8686
regex="${TFENV_VERSION##*\:}";
8787
log 'debug' "'latest' keyword uses regex: ${regex}";
8888
else
89-
regex='.*'; # Just saves a separate command below without the grep
90-
log 'debug' "'latest' keyword does not use regex";
89+
regex="^[0-9]\+\.[0-9]\+\.[0-9]\+$";
90+
log 'debug' "Version uses latest keyword alone. Forcing regex to match stable versions only: ${regex}";
9191
fi;
9292

9393
declare local_version='';

0 commit comments

Comments
 (0)