fluxcd-flux2/tests/azure/terraform.go
Philip Laine d8235ea21b Add Azure E2E tests
Signed-off-by: Philip Laine <philip.laine@xenit.se>
2021-10-04 14:15:58 +02:00

19 lines
353 B
Go

package test
import (
"context"
"os/exec"
"strings"
)
type whichTerraform struct{}
func (w *whichTerraform) ExecPath(ctx context.Context) (string, error) {
cmd := exec.CommandContext(ctx, "which", "terraform")
output, err := cmd.Output()
if err != nil {
return "", err
}
path := strings.TrimSuffix(string(output), "\n")
return path, nil
}