mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2024-11-09 20:44:03 -08:00
fix(upgrade): disable upgrade feedback when notice is disabled
resolves #5124
This commit is contained in:
parent
b6f5999e21
commit
b809944f5c
|
@ -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"
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue