We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0c9b7b7 commit d6cd58bCopy full SHA for d6cd58b
cmd/tmcg/main.go
@@ -7,6 +7,7 @@ import (
7
"fmt"
8
"io"
9
"os"
10
+ "os/exec"
11
"path/filepath"
12
"strings"
13
"time"
@@ -156,10 +157,12 @@ func Run(exitFunc func(int), logger logging.Logger) {
156
157
158
// Validate Terraform binary
159
logger.Log("debug", "Using Terraform binary: %s", binaryPath)
- if _, err := os.Stat(binaryPath); os.IsNotExist(err) {
160
- logger.Log("error", "Terraform binary not found at: %s", binaryPath)
+ path, err := exec.LookPath(binaryPath)
161
+ if err != nil {
162
+ logger.Log("error", "Terraform binary not found in PATH: %s", binaryPath)
163
exitFunc(1)
164
}
165
+ logger.Log("debug", "Resolved Terraform binary path: %s", path)
166
167
// Start timer for execution
168
startTime := time.Now()
0 commit comments