feat(upgrade): correct command for major upgrades
Some checks are pending
Code QL / code-ql (push) Waiting to run
Release / changelog (push) Waiting to run
Release / artifacts (push) Blocked by required conditions

resolves #5883
This commit is contained in:
Jan De Dobbeleer 2024-11-14 09:45:25 +01:00 committed by Jan De Dobbeleer
parent d023b76a7f
commit e005f898fe

View file

@ -37,7 +37,7 @@ const (
upgradeNotice = ` upgradeNotice = `
A new release of Oh My Posh is available: %s %s A new release of Oh My Posh is available: %s %s
To upgrade, run: 'oh-my-posh upgrade' To upgrade, run: 'oh-my-posh upgrade%s'
To enable automated upgrades, run: 'oh-my-posh enable autoupgrade'. To enable automated upgrades, run: 'oh-my-posh enable autoupgrade'.
` `
@ -91,5 +91,10 @@ func Notice(env runtime.Environment, force bool) (string, bool) {
return "", false return "", false
} }
return fmt.Sprintf(upgradeNotice, version, latest), true var forceUpdate string
if IsMajorUpgrade(version, latest) {
forceUpdate = " --force"
}
return fmt.Sprintf(upgradeNotice, version, latest, forceUpdate), true
} }