Skip to content

Commit

Permalink
Fix empty path check order
Browse files Browse the repository at this point in the history
  • Loading branch information
paultyng committed Aug 29, 2020
1 parent c2275e5 commit 0f1e126
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tfinstall/tfinstall.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit 0f1e126

Please sign in to comment.