Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions pkg/commands/compute/serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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.
Expand Down Expand Up @@ -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))
}

Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down Expand Up @@ -217,7 +218,6 @@ func (f *File) Read(
/* #nosec */
data, err := os.ReadFile(path)
if err != nil {
errLog.Add(err)
data = Static
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/manifest/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down