Skip to content
This repository has been archived by the owner on Jun 9, 2022. It is now read-only.

Commit

Permalink
format error msg
Browse files Browse the repository at this point in the history
  • Loading branch information
martinnirtl committed Feb 24, 2020
1 parent 1064db0 commit b480dc7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkg/externalcommand/externalcommand.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import (
"os"
"os/exec"
"strings"

"github.com/ttacon/chalk"
)

// JoinCommand joins all command slices with spaces
Expand Down Expand Up @@ -47,12 +49,12 @@ func Execute(command string, timebridger Timebridger, logfile string) ([]byte, e
fileError := ioutil.WriteFile(logfile, output, 0644)

if fileError != nil {
return output, fmt.Errorf("Could not save output to logfile: %s", logfile)
return output, fmt.Errorf("Could not save output to logfile %s", chalk.Underline.TextStyle(logfile))
}
}

if commandError != nil {
return output, fmt.Errorf("Could not run command: %s", command)
return output, fmt.Errorf("Could not run command %s", chalk.Underline.TextStyle(command))
}

return output, nil
Expand Down

0 comments on commit b480dc7

Please sign in to comment.