Skip to content

Allow disabling fallback for detect commands #502

@reegnz

Description

@reegnz

Is your feature request related to a problem? Please describe.
I need to determine if a folder has tofu or terraform configured for it. If tofu version file is present I run tofu commands, if terraform version file is present I run terraform commands.
tenv tofu detect almost seems like the right command, but if it fails finding version files, a fallback strategy is triggered to select a tofu version, and the exit code of the command will be 0.

Describe the solution you'd like
tenv tofu detect --no-fallback command, that fails if no version files are found for tofu, and the command exits with a non-zero exit code.
tenv tf detect --no-fallback command, that fails if no version files are found for tofu, and the command exits with a non-zero exit code.
etc.

Describe alternatives you've considered
Parsing stdin for the message "No version files found".

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions