diff --git a/tfinstall/tfinstall.go b/tfinstall/tfinstall.go index 898768b2..46e3fb53 100644 --- a/tfinstall/tfinstall.go +++ b/tfinstall/tfinstall.go @@ -129,15 +129,15 @@ func Find(opts ...ExecPathFinder) (string, error) { } } + if terraformPath == "" { + return "", fmt.Errorf("could not find terraform executable") + } + err := runTerraformVersion(terraformPath) if err != nil { return "", fmt.Errorf("executable found at path %s is not terraform: %s", terraformPath, err) } - if terraformPath == "" { - return "", fmt.Errorf("could not find terraform executable") - } - return terraformPath, nil }