Skip to content

Trailing whitespace breaks version resolution #431

@Meosit

Description

@Meosit

I was setting up existing repo with .terraform-version file of the project that I've just pulled and there is a issue that I was facing:

data-infra $ terraform -v
/opt/homebrew/Cellar/tfenv/3.0.0/lib/tfenv-version-name.sh: line 75: requested: unbound variable

The root cause of the issue is that the .terraform-version had the following content (WITH new line in the end of the file):

latest:^1.7

The issue fix probably should be located here: https://github.com/tfutils/tfenv/blob/v3.0.0/libexec/tfenv-resolve-version#L132

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions