Skip to content

Commit

Permalink
chore(cmd): move logger to top of cmd loop
Browse files Browse the repository at this point in the history
  • Loading branch information
PhearZero committed Jan 14, 2025
1 parent abcb9ed commit 8c44cae
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion internal/system/cmds.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,14 @@ func Run(args []string) (string, error) {
func RunAll(list CmdsList) error {
// Run each installation command
for _, args := range list {
log.Debug(fmt.Sprintf("%s: %s", style.Green.Render("Running"), strings.Join(args, " ")))
cmd := exec.Command(args[0], args[1:]...)
output, err := cmd.CombinedOutput()
if err != nil {
log.Error(fmt.Sprintf("%s: %s", style.Red.Render("Failed"), strings.Join(args, " ")))
return fmt.Errorf(CmdFailedErrorMsg, strings.Join(args, " "), output, err)
}
log.Debug(fmt.Sprintf("%s: %s", style.Green.Render("Running"), strings.Join(args, " ")))

}
return nil
}
Expand Down

0 comments on commit 8c44cae

Please sign in to comment.