Skip to content

Commit

Permalink
Ensure all outputs from the commands are sent to func as string
Browse files Browse the repository at this point in the history
  • Loading branch information
asteel-gsa committed May 7, 2024
1 parent e4ca64e commit ac4f7db
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions cmd/install_aws.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand All @@ -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{
Expand All @@ -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 {
Expand Down

0 comments on commit ac4f7db

Please sign in to comment.