Skip to content

Commit b8cee37

Browse files
lewis-yeungJanDeDobbeleer
authored andcommitted
fix(upgrade): disable auto upgrade in default config
1 parent 96bf7e1 commit b8cee37

File tree

5 files changed

+2
-13
lines changed

5 files changed

+2
-13
lines changed

src/cli/notice.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ var noticeCmd = &cobra.Command{
2626

2727
sh := os.Getenv("POSH_SHELL")
2828
cfg, _ := config.Load(configFlag, sh, false)
29-
cfg.Upgrade.Cache = env.Cache()
3029

3130
if notice, hasNotice := cfg.Upgrade.Notice(); hasNotice {
3231
fmt.Println(notice)

src/cli/upgrade.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ var upgradeCmd = &cobra.Command{
5858
fmt.Print(terminal.StartProgress())
5959

6060
cfg, _ := config.Load(configFlag, sh, false)
61-
cfg.Upgrade.Cache = env.Cache()
6261

6362
defer func() {
6463
fmt.Print(terminal.StopProgress())

src/cli/upgrade/config.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import (
1414
)
1515

1616
type Config struct {
17-
Cache cache.Cache `json:"-" toml:"-" yaml:"-"`
1817
Source Source `json:"source" toml:"source" yaml:"source"`
1918
Interval cache.Duration `json:"interval" toml:"interval" yaml:"interval"`
2019
Latest string `json:"-" toml:"-" yaml:"-"`

src/cli/upgrade/notice_test.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@ import (
55
"testing"
66

77
"github.com/jandedobbeleer/oh-my-posh/src/build"
8-
cache_ "github.com/jandedobbeleer/oh-my-posh/src/cache/mock"
98
"github.com/stretchr/testify/assert"
10-
testify_ "github.com/stretchr/testify/mock"
119
)
1210

1311
func TestCanUpgrade(t *testing.T) {
@@ -30,10 +28,6 @@ func TestCanUpgrade(t *testing.T) {
3028

3129
for _, tc := range cases {
3230
build.Version = tc.CurrentVersion
33-
c := &cache_.Cache{}
34-
c.On("Get", CACHEKEY).Return("", tc.Cache)
35-
c.On("Set", testify_.Anything, testify_.Anything, testify_.Anything)
36-
ugc.Cache = c
3731

3832
if len(tc.Installer) > 0 {
3933
os.Setenv("POSH_INSTALLER", tc.Installer)

src/config/default.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -197,10 +197,8 @@ func Default(warning bool) *Config {
197197
},
198198
},
199199
Upgrade: &upgrade.Config{
200-
Source: upgrade.CDN,
201-
DisplayNotice: true,
202-
Auto: true,
203-
Interval: cache.ONEWEEK,
200+
Source: upgrade.CDN,
201+
Interval: cache.ONEWEEK,
204202
},
205203
}
206204

0 commit comments

Comments
 (0)