feat(upgrade): remove no new version notice

This commit is contained in:
Jan De Dobbeleer 2024-08-27 09:34:00 +02:00 committed by Jan De Dobbeleer
parent 50d209e773
commit c289a038ac
2 changed files with 2 additions and 12 deletions

View file

@ -7,7 +7,6 @@ import (
"slices"
"github.com/jandedobbeleer/oh-my-posh/src/build"
"github.com/jandedobbeleer/oh-my-posh/src/config"
"github.com/jandedobbeleer/oh-my-posh/src/runtime"
"github.com/jandedobbeleer/oh-my-posh/src/terminal"
"github.com/jandedobbeleer/oh-my-posh/src/upgrade"
@ -30,7 +29,6 @@ var upgradeCmd = &cobra.Command{
}
if !slices.Contains(supportedPlatforms, stdruntime.GOOS) {
fmt.Print("\n⚠ upgrade is not supported on this platform\n\n")
return
}
@ -53,8 +51,6 @@ var upgradeCmd = &cobra.Command{
return
}
cfg := config.Load(env)
version := fmt.Sprintf("v%s", build.Version)
if upgrade.IsMajorUpgrade(version, latest) {
@ -69,13 +65,7 @@ var upgradeCmd = &cobra.Command{
return
}
message := terminal.StopProgress()
if !cfg.DisableNotice {
message += "\n✅ no new version available\n\n"
}
fmt.Print(message)
fmt.Print(terminal.StopProgress())
},
}

View file

@ -136,7 +136,7 @@ For example, the following is a valid `--config` flag:
| `shell_integration` | `boolean` | `false` | enable shell integration using FinalTerm's OSC sequences. Works in bash, cmd (Clink v1.14.25+), fish, powershell and zsh |
| `enable_cursor_positioning` | `boolean` | `false` | enable fetching the cursor position in bash and zsh to allow automatic hiding of leading newlines when at the top of the shell |
| `patch_pwsh_bleed` | `boolean` | `false` | patch a PowerShell bug where the background colors bleed into the next line at the end of the buffer (can be removed when [this][pwsh-bleed] is merged) |
| `disable_notice` | `boolean` | `false` | disables the notice that a new upgrade is available when `auto_upgrade` is disabled, and the notice that no new upgrade is available when `auto_upgrade` is enabled |
| `disable_notice` | `boolean` | `false` | disables the notice that a new upgrade is available when `auto_upgrade` is disabled |
| `auto_upgrade` | `boolean` | `false` | enable automatic upgrades for Oh My Posh (supports Windows, macOS and Linux) |
| `iterm_features` | `[]string` | `false` | enable iTerm2 specific features:<ul><li>`prompt_mark`: add the `iterm2_prompt_mark` [function][iterm2-si] for supported shells</li><li>`current_dir`: expose the current directory for iTerm2</li><li>`remote_host`: expose the current remote and user for iTerm2</li></ul> |