Skip to content

Commit

Permalink
fix(upgrade): disable upgrade feedback when notice is disabled
Browse files Browse the repository at this point in the history
resolves #5124
  • Loading branch information
JanDeDobbeleer committed Jun 20, 2024
1 parent 5bdfd9f commit 1cb754b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/cli/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"fmt"
"runtime"

"github.com/jandedobbeleer/oh-my-posh/src/engine"
"github.com/jandedobbeleer/oh-my-posh/src/platform"
"github.com/jandedobbeleer/oh-my-posh/src/upgrade"
"github.com/spf13/cobra"
Expand Down Expand Up @@ -34,8 +35,12 @@ var upgradeCmd = &cobra.Command{
return
}

cfg := engine.LoadConfig(env)

if _, hasNotice := upgrade.Notice(env, true); !hasNotice {
fmt.Print("\n✅ no new version available\n\n")
if !cfg.DisableNotice {
fmt.Print("\n✅ no new version available\n\n")
}
return
}

Expand Down

0 comments on commit 1cb754b

Please sign in to comment.