From f5ca105aea6926e4322a9fed854add90b8c38da9 Mon Sep 17 00:00:00 2001 From: Dagen Brock Date: Tue, 27 Apr 2021 15:54:22 -0500 Subject: [PATCH] show colorized output when assembly fails --- core/assembler.go | 6 +++--- go.mod | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/core/assembler.go b/core/assembler.go index 1e09d94..c0a4397 100644 --- a/core/assembler.go +++ b/core/assembler.go @@ -5,6 +5,7 @@ import ( "log" "os/exec" + "github.com/fatih/color" "github.com/spf13/viper" ) @@ -21,11 +22,10 @@ func Assemble() { for _, filename := range filesToAssemble { fmt.Printf("Assembling %v\n", filename) - cmd := exec.Command(Merlin32Path, "-V", filename) - - err := cmd.Run() + out, err := exec.Command(Merlin32Path, "-V", filename).Output() if err != nil { + color.Cyan(string(out)) log.Fatal(err) } } diff --git a/go.mod b/go.mod index 6333164..4ee12ca 100644 --- a/go.mod +++ b/go.mod @@ -3,6 +3,7 @@ module github.com/digarok/appy go 1.16 require ( + github.com/fatih/color v1.10.0 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/spf13/cobra v1.1.3 // indirect github.com/spf13/viper v1.7.1 // indirect