mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2024-12-28 20:39:40 -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"
|
"fmt"
|
||||||
"runtime"
|
"runtime"
|
||||||
|
|
||||||
|
"github.com/jandedobbeleer/oh-my-posh/src/engine"
|
||||||
"github.com/jandedobbeleer/oh-my-posh/src/platform"
|
"github.com/jandedobbeleer/oh-my-posh/src/platform"
|
||||||
"github.com/jandedobbeleer/oh-my-posh/src/upgrade"
|
"github.com/jandedobbeleer/oh-my-posh/src/upgrade"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
|
@ -34,8 +35,12 @@ var upgradeCmd = &cobra.Command{
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cfg := engine.LoadConfig(env)
|
||||||
|
|
||||||
if _, hasNotice := upgrade.Notice(env, true); !hasNotice {
|
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
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue