Skip to content

Commit

Permalink
Add graceful fail for min-required
Browse files Browse the repository at this point in the history
Even when setting `TFENV_TERRAFORM_VERSION` to `min-required`,
we might prefer to fallback on the normal inference method
rather than a hard fail.

Resolves tfutils#353
  • Loading branch information
JeanFred committed Oct 25, 2022
1 parent 1ccfddb commit ad3a7e7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/tfenv-version-name.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ function tfenv-version-name() {
TFENV_VERSION="${potential_min_required}" \
TFENV_VERSION_SOURCE='terraform{required_version}';
else
log 'error' 'Specifically asked for min-required via terraform{required_version}, but none found';
log 'debug' 'Specifically asked for min-required via terraform{required_version}, but none found, falling back to normal detection';
TFENV_TERRAFORM_VERSION="";
echo $(tfenv-version-name);
fi;
fi;

Expand Down

0 comments on commit ad3a7e7

Please sign in to comment.