diff --git a/realize.go b/realize.go index 24073fd..e67d5a2 100644 --- a/realize.go +++ b/realize.go @@ -869,6 +869,24 @@ func main() { return nil }, }, + { + Before: func(d interact.Context) error { + d.SetDef("", style.Green.Regular("(none)")) + return nil + }, + Quest: interact.Quest{ + Options: style.Yellow.Regular("[string]"), + Msg: "Set an error output pattern", + }, + Action: func(d interact.Context) interface{} { + val, err := d.Ans().String() + if err != nil { + return d.Err() + } + r.Blueprint.Projects[len(r.Blueprint.Projects)-1].ErrorOutputPattern = val + return nil + }, + }, }, Action: func(d interact.Context) interface{} { if val, err := d.Ans().Bool(); err != nil { diff --git a/watcher/cmd.go b/watcher/cmd.go index 46d7c02..4693235 100644 --- a/watcher/cmd.go +++ b/watcher/cmd.go @@ -91,7 +91,6 @@ func (h *Blueprint) Add(p *cli.Context) error { Scripts: []Command{}, }, Streams: Streams{ - CliOut: true, FileOut: false, FileLog: false, FileErr: false, @@ -170,7 +169,6 @@ func (h *Blueprint) List() error { } } fmt.Println(name, style.Yellow.Regular("Streams"), ":") - fmt.Println(name, "\t", style.Yellow.Regular("Cli Out"), ":", style.Magenta.Regular(val.Streams.CliOut)) fmt.Println(name, "\t", style.Yellow.Regular("File Out"), ":", style.Magenta.Regular(val.Streams.FileOut)) fmt.Println(name, "\t", style.Yellow.Regular("File Log"), ":", style.Magenta.Regular(val.Streams.FileLog)) fmt.Println(name, "\t", style.Yellow.Regular("File Err"), ":", style.Magenta.Regular(val.Streams.FileErr)) diff --git a/watcher/main.go b/watcher/main.go index 3a4c3bc..2041862 100644 --- a/watcher/main.go +++ b/watcher/main.go @@ -39,9 +39,9 @@ type Project struct { Cmds Cmds `yaml:"commands" json:"commands"` Args []string `yaml:"args,omitempty" json:"args,omitempty"` Watcher Watcher `yaml:"watcher" json:"watcher"` - Streams Streams `yaml:"streams" json:"streams"` + Streams Streams `yaml:"streams,omitempty" json:"streams,omitempty"` Buffer Buffer `yaml:"-" json:"buffer"` - ErrorOutputPattern string `yaml:"errorOutputPattern" json:"errorOutputPattern"` + ErrorOutputPattern string `yaml:"errorOutputPattern,omitempty" json:"errorOutputPattern,omitempty"` parent *Blueprint path string tools tools @@ -92,7 +92,6 @@ type Command struct { // Streams is a collection of names and values for the logs functionality type Streams struct { - CliOut bool `yaml:"cli_out" json:"cli_out"` FileOut bool `yaml:"file_out" json:"file_out"` FileLog bool `yaml:"file_log" json:"file_log"` FileErr bool `yaml:"file_err" json:"file_err"` diff --git a/watcher/watcher.go b/watcher/watcher.go index 0e9f2be..2dc7fd7 100644 --- a/watcher/watcher.go +++ b/watcher/watcher.go @@ -384,9 +384,6 @@ func (p *Project) print(t string, o BufferOut, msg string, stream string) { p.Fatal(err, "") } } - if msg != "" && p.Streams.CliOut { - log.Print(msg) - } case "log": p.Buffer.StdLog = append(p.Buffer.StdLog, o) if p.Streams.FileLog {