From 0f1e1267cea23e5403e23085ca253f0ab425d8d9 Mon Sep 17 00:00:00 2001 From: Paul Tyng Date: Wed, 26 Aug 2020 10:19:34 -0400 Subject: [PATCH] Fix empty path check order --- tfinstall/tfinstall.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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 }