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
2 changes: 2 additions & 0 deletions cmd/flags/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
type GlobalFlags struct {
Silent bool
NoWarn bool
NoColors bool
Debug bool
DisableProfileActivation bool
SwitchContext bool
Expand Down Expand Up @@ -45,6 +46,7 @@ func SetGlobalFlags(flags *flag.FlagSet) *GlobalFlags {

flags.StringVar(&globalFlags.OverrideName, "override-name", "", "If specified will override the devspace.yaml name")
flags.BoolVar(&globalFlags.NoWarn, "no-warn", false, "If true does not show any warning when deploying into a different namespace or kube-context than before")
flags.BoolVar(&globalFlags.NoColors, "no-colors", false, "Do not show color highlighting in log output. This avoids invisible output with different terminal background colors")
flags.BoolVar(&globalFlags.Debug, "debug", false, "Prints the stack trace if an error occurs")
flags.BoolVar(&globalFlags.Silent, "silent", false, "Run in silent mode and prevents any devspace log output except panics & fatals")

Expand Down
6 changes: 5 additions & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ import (
"context"
"flag"
"fmt"
"github.com/loft-sh/devspace/pkg/devspace/kill"
"io"
"os"
"strings"
"sync"
"time"

"github.com/loft-sh/devspace/pkg/devspace/kill"
"github.com/mgutz/ansi"

"github.com/loft-sh/devspace/pkg/devspace/config/loader"
"github.com/loft-sh/devspace/pkg/devspace/config/loader/variable/expression"
"github.com/loft-sh/devspace/pkg/devspace/config/versions/latest"
Expand Down Expand Up @@ -65,6 +67,8 @@ func NewRootCmd(f factory.Factory) *cobra.Command {
log.SetLevel(logrus.DebugLevel)
}

ansi.DisableColors(globalFlags.NoColors)

if globalFlags.KubeConfig != "" {
err := os.Setenv("KUBECONFIG", globalFlags.KubeConfig)
if err != nil {
Expand Down
8 changes: 4 additions & 4 deletions pkg/devspace/services/proxycommands/rewrite.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,12 @@ func (t Transformer) Transform(dst, src []byte, atEOF bool) (nDst, nSrc int, err
nSrc += n
nDst += n
if err != nil {
return
return nSrc, nDst, err
}
// copy the new value
n, err = fullcopy(dst[nDst:], t.new)
if err != nil {
return
return nSrc, nDst, err
}
nDst += n
nSrc += t.oldlen
Expand All @@ -86,7 +86,7 @@ func (t Transformer) Transform(dst, src []byte, atEOF bool) (nDst, nSrc int, err
n, err = fullcopy(dst[nDst:], src[nSrc:])
nDst += n
nSrc += n
return
return nSrc, nDst, err
}
// skip everything except the trailing len(r.old) - 1
// we do this because there could be a match straddling
Expand All @@ -96,7 +96,7 @@ func (t Transformer) Transform(dst, src []byte, atEOF bool) (nDst, nSrc int, err
nSrc += n
nDst += n
if err != nil {
return
return nSrc, nDst, err
}
}
err = transform.ErrShortSrc
Expand Down