Skip to content

Commit

Permalink
TERRAFORM envvar renamed to TERRAFORM_PATH
Browse files Browse the repository at this point in the history
  • Loading branch information
dex4er committed Sep 14, 2023
1 parent c621d59 commit 4aca9a2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,11 @@ It is recommended to use `$()` rather than `xargs` for `tf apply` or `tf destroy

For not recognized commands `tf` passes all arguments to `terraform` command.

`terraform` command might be replaced with another using `TERRAFORM`
`terraform` command might be replaced with another using `TERRAFORM_PATH`
environment variable, ie.:

```sh
export TERRAFORM=opentf
export TERRAFORM_PATH=opentf
```

### `tf apply`
Expand Down
10 changes: 5 additions & 5 deletions run/exec_terraform_command.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ import (
"os/exec"
)

var TERRAFORM = os.Getenv("TERRAFORM")
var TERRAFORM_PATH = os.Getenv("TERRAFORM_PATH")

func execTerraformCommand(arg ...string) *exec.Cmd {
name := TERRAFORM
if TERRAFORM == "" {
name = "terraform"
path := TERRAFORM_PATH
if TERRAFORM_PATH == "" {
path = "terraform"
}
return exec.Command(name, arg...)
return exec.Command(path, arg...)
}

0 comments on commit 4aca9a2

Please sign in to comment.