diff --git a/pkg/commands/compute/serve.go b/pkg/commands/compute/serve.go index cc55233b2..83dd3f694 100644 --- a/pkg/commands/compute/serve.go +++ b/pkg/commands/compute/serve.go @@ -19,6 +19,10 @@ import ( "github.com/bep/debounce" "github.com/blang/semver" + "github.com/fatih/color" + "github.com/fsnotify/fsnotify" + ignore "github.com/sabhiram/go-gitignore" + "github.com/fastly/cli/pkg/check" "github.com/fastly/cli/pkg/cmd" fsterr "github.com/fastly/cli/pkg/errors" @@ -28,9 +32,6 @@ import ( "github.com/fastly/cli/pkg/global" "github.com/fastly/cli/pkg/manifest" "github.com/fastly/cli/pkg/text" - "github.com/fatih/color" - "github.com/fsnotify/fsnotify" - ignore "github.com/sabhiram/go-gitignore" ) // ServeCommand produces and runs an artifact from files on the local disk. @@ -594,8 +595,8 @@ func local(bin, file, addr, env string, debug, watch bool, watchDir cmd.Optional // Disabling as we trust the source of the variable. // #nosec // nosemgrep: go.lang.security.audit.dangerous-exec-command.dangerous-exec-command - cmd := exec.Command(bin, "--version") - if output, err := cmd.Output(); err == nil { + c := exec.Command(bin, "--version") + if output, err := c.Output(); err == nil { text.Output(out, "%s:\n%s", text.BoldYellow("Viceroy version"), string(output)) } @@ -652,7 +653,9 @@ func local(bin, file, addr, env string, debug, watch bool, watchDir cmd.Optional // How big an issue this is depends on how many file modifications a user // makes, because having lots of signal listeners could exhaust resources. if err := s.Exec(); err != nil { - errLog.Add(err) + if !strings.Contains(err.Error(), "signal: ") { + errLog.Add(err) + } e := strings.TrimSpace(err.Error()) if strings.Contains(e, "interrupt") { return fsterr.ErrSignalInterrupt diff --git a/pkg/config/config.go b/pkg/config/config.go index f5b53a8c5..ca2ea8d5a 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -8,12 +8,13 @@ import ( "os" "path/filepath" + toml "github.com/pelletier/go-toml" + "github.com/fastly/cli/pkg/env" fsterr "github.com/fastly/cli/pkg/errors" "github.com/fastly/cli/pkg/filesystem" "github.com/fastly/cli/pkg/revision" "github.com/fastly/cli/pkg/text" - toml "github.com/pelletier/go-toml" ) const ( @@ -217,7 +218,6 @@ func (f *File) Read( /* #nosec */ data, err := os.ReadFile(path) if err != nil { - errLog.Add(err) data = Static } diff --git a/pkg/manifest/file.go b/pkg/manifest/file.go index 8cc9993d5..78fb74360 100644 --- a/pkg/manifest/file.go +++ b/pkg/manifest/file.go @@ -16,7 +16,7 @@ import ( // manifest file schema. type File struct { // Args is necessary to track the subcommand called (see: File.Read method). - Args []string `toml:"omitempty"` + Args []string `toml:",omitempty"` Authors []string `toml:"authors"` Description string `toml:"description"` Language string `toml:"language"`