From f0efeb5b0f0099b0fbbbc6ea13232425014ed621 Mon Sep 17 00:00:00 2001 From: Mario Di Miceli Date: Tue, 14 May 2024 09:59:05 +0200 Subject: [PATCH] fix lint and unit tests --- commands/usage_test.go | 22 ++++++++++++---------- terraform/binary_path.go | 8 ++++---- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/commands/usage_test.go b/commands/usage_test.go index a7f2ae83f..08c56ee5a 100644 --- a/commands/usage_test.go +++ b/commands/usage_test.go @@ -39,11 +39,12 @@ Usage: bbl [GLOBAL OPTIONS] COMMAND [OPTIONS] Global Options: - --help [-h] Prints usage. Use "bbl [command] --help" for more information about a command - --state-dir [-s] Directory containing the bbl state env:"BBL_STATE_DIRECTORY" - --debug [-d] Prints debugging output env:"BBL_DEBUG" - --version [-v] Prints version - --no-confirm [-n] No confirm + --help [-h] Prints usage. Use "bbl [command] --help" for more information about a command + --state-dir [-s] Directory containing the bbl state env:"BBL_STATE_DIRECTORY" + --debug [-d] Prints debugging output env:"BBL_DEBUG" + --version [-v] Prints version + --no-confirm [-n] No confirm + --use-tf-local-binary [-u] Use the local terraform binary if it exists env:"BBL_USE_TF_LOCAL_BINARY" Basic Commands: A good place to start up Deploys BOSH director on an IAAS, creates CF/Concourse load balancers. Updates existing director. @@ -84,11 +85,12 @@ Troubleshooting Commands: bbl [GLOBAL OPTIONS] my-command [OPTIONS] Global Options: - --help [-h] Prints usage. Use "bbl [command] --help" for more information about a command - --state-dir [-s] Directory containing the bbl state env:"BBL_STATE_DIRECTORY" - --debug [-d] Prints debugging output env:"BBL_DEBUG" - --version [-v] Prints version - --no-confirm [-n] No confirm + --help [-h] Prints usage. Use "bbl [command] --help" for more information about a command + --state-dir [-s] Directory containing the bbl state env:"BBL_STATE_DIRECTORY" + --debug [-d] Prints debugging output env:"BBL_DEBUG" + --version [-v] Prints version + --no-confirm [-n] No confirm + --use-tf-local-binary [-u] Use the local terraform binary if it exists env:"BBL_USE_TF_LOCAL_BINARY" [my-command command options] some message diff --git a/terraform/binary_path.go b/terraform/binary_path.go index 80d5e3583..ea1f765fc 100644 --- a/terraform/binary_path.go +++ b/terraform/binary_path.go @@ -50,10 +50,10 @@ func NewBinary(tfUseLocalBinary bool) *Binary { func (binary *Binary) BinaryPath() (string, error) { // if user has a terraform use it if binary.UseLocalBinary { - userTerraform, err := exec.LookPath(tfBinDataAssetName) - if err == nil && userTerraform != "" { - return userTerraform, nil - } + userTerraform, err := exec.LookPath(tfBinDataAssetName) + if err == nil && userTerraform != "" { + return userTerraform, nil + } } destinationPath := fmt.Sprintf("%s/%s", binary.FS.GetTempDir(os.TempDir()), bblTfBinaryName)