Skip to content

Commit

Permalink
feat(upgrade): correct command for major upgrades
Browse files Browse the repository at this point in the history
resolves #5883
  • Loading branch information
JanDeDobbeleer committed Nov 14, 2024
1 parent d023b76 commit e005f89
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/upgrade/notice.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const (

upgradeNotice = `
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'.
`
Expand Down Expand Up @@ -91,5 +91,10 @@ func Notice(env runtime.Environment, force bool) (string, bool) {
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
}

0 comments on commit e005f89

Please sign in to comment.