Skip to content

Commit 2efd100

Browse files
mdimicelijpalermo
authored andcommitted
if user has a terraform use it
1 parent db7bb17 commit 2efd100

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

terraform/binary_path.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"errors"
66
"fmt"
77
"os"
8+
"os/exec"
89
"strconv"
910
"strings"
1011
"time"
@@ -45,6 +46,12 @@ func NewBinary() *Binary {
4546
}
4647

4748
func (binary *Binary) BinaryPath() (string, error) {
49+
// if user has a terraform use it
50+
userTerraform, err := exec.LookPath("terraform")
51+
if err == nil && userTerraform != "" {
52+
return userTerraform, nil
53+
}
54+
4855
destinationPath := fmt.Sprintf("%s/%s", binary.FS.GetTempDir(os.TempDir()), bblTfBinaryName)
4956
exists, err := binary.FS.Exists(destinationPath)
5057
if err != nil {

0 commit comments

Comments
 (0)