Commit 966b174a authored by nimrod's avatar nimrod
Browse files

Support more commands with OpenTofu 1.8.

OpenTofu 1.8 allows using the `-var-file` switch in almost all of the
commands. Terraform does not. Add support if not using Terraform.
parent 4a35b4f1
Loading
Loading
Loading
Loading
Loading
+24 −1
Original line number Diff line number Diff line
@@ -10,8 +10,31 @@ import sys

__version__ = "0.2.0"

TF_COMMANDS_TO_MODIFY = ["plan", "console", "import", "refresh"]
TF_CLI = os.getenv("TF_CLI", "terraform")
TF_COMMANDS_TO_MODIFY = (
    [
        "console",
        "import",
        "plan",
        "refresh",
    ]
    if TF_CLI == "terraform"
    else [
        "apply",
        "console",
        "destroy",
        "destroy",
        "get",
        "import",
        "init",
        "output",
        "plan",
        "refresh",
        "taint",
        "untaint",
        "validate",
    ]
)


def get_workspace():