From ac4f7db8bbb68ecfc8b14f22397fff85e1a9076e Mon Sep 17 00:00:00 2001 From: Alex Steel <130377221+asteel-gsa@users.noreply.github.com> Date: Tue, 7 May 2024 13:23:06 -0400 Subject: [PATCH] Ensure all outputs from the commands are sent to func as string --- cmd/install_aws.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cmd/install_aws.go b/cmd/install_aws.go index 67d7bd0..3dd7370 100644 --- a/cmd/install_aws.go +++ b/cmd/install_aws.go @@ -58,7 +58,7 @@ var installAwsCmd = &cobra.Command{ logging.Logger.Printf("Running command: " + curlCommand) curl := exec.Command("bash", "-c", curlCommand) curlOutput, curlError := curl.Output() - ErrorCheck(curlOutput, curlError) + ErrorCheck(string(curlOutput), curlError) // unzip awscliv2.zip && rm awscliv2.zip unzipaws := []string{ @@ -73,7 +73,7 @@ var installAwsCmd = &cobra.Command{ logging.Logger.Printf("Running command: " + unzipCommand) extract := exec.Command("bash", "-c", unzipCommand) unzipOutput, unzipError := extract.Output() - ErrorCheck(unzipOutput, unzipError) + ErrorCheck(string(unzipOutput), unzipError) // ./aws/install -i ~/usr -b ~/bin installaws := []string{ @@ -88,7 +88,8 @@ var installAwsCmd = &cobra.Command{ logging.Logger.Printf("Running command: " + installCommand) install := exec.Command("bash", "-c", installCommand) installOutput, installError := install.Output() - ErrorCheck(installOutput, installError) + ErrorCheck(string(installOutput), installError) + // Regardless of the case, check to see if AWS-CLI is installed or not. CheckInstallation() } else {