Skip to content

Commit df06d7c

Browse files
committed
Accept some latest:<regex> versions
According to the tfenv documentation https://github.com/tfutils/tfenv#terraform-version-file, versions can also be specified using a regex, where the most common one, a prefix match, is now also supported by this plugin
1 parent 197e3ec commit df06d7c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

bin/parse-legacy-file

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ get_legacy_version() {
5353
[[ ${this_plugin_supported} == false ]] && return 0
5454

5555
if [[ ${version_file} == *".${THIS_PLUGIN}-version" && -r ${version_file} ]]; then
56-
cat "${version_file}"
56+
cat "${version_file}" | sed -e 's/^latest:\^//g'
5757
elif [[ ${version_file} =~ ${ASDF_HASHICORP_TERRAFORM_VERSION_FILE:-main.tf} && -r ${version_file} ]]; then
5858
read_version_from_main_tf "${version_file}"
5959
fi

0 commit comments

Comments
 (0)