Skip to content

Add version block even if block is missing #72

@nitrocode

Description

@nitrocode

I noticed if I ran this, it doesn't return any output, and exits with 0 even though it did not make any modification to the module.

This module does not have a terraform { required_version = "x.y.z" } block.

tfupdate terraform -v ">= 1.0.0" my_module/

It would be nice if it would by default or by an additional option, it could add this block to a specified file, and if no specified file, it could add/append it to the module's versions.tf.

# if no required_version block, this creates a new versions.tf with this version set
tfupdate terraform -v ">= 1.0.0" my_module/
# if no required_version block, this creates a new my_versions.tf with this version set
tfupdate terraform -v ">= 1.0.0" my_module/my_versions.tf

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions