Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enabling automated upgrades #5734

Closed
1 task done
jefmeijvis opened this issue Oct 11, 2024 · 3 comments · Fixed by #5735
Closed
1 task done

Enabling automated upgrades #5734

jefmeijvis opened this issue Oct 11, 2024 · 3 comments · Fixed by #5735
Assignees
Labels
🤩 enhancement Improvement of a feature

Comments

@jefmeijvis
Copy link

Code of Conduct

  • I agree to follow this project's Code of Conduct

What would you like to see changed?

Current situation

At the moment, when a new version of Oh My Posh is available, users are shown the following message when the terminal is launched:

A new release of Oh My Posh is available: vxx.xx.x → vxx.xx.x
To upgrade, run: 'oh-my-posh upgrade'
To enable automated upgrades, set 'auto_upgrade' to 'true' in your configuration.

I believe there are two scenarios on how a user can enable automatic updates:

The user has no custom configuration

  1. Export your current "off-the-shelf" theme via following command: oh-my-posh config export --output ~/.mytheme.omp.json
  2. Edit the newly created custom configuration and add {"auto_upgrade": true}
  3. Edit the $PROFILE file so it uses the new configuration file oh-my-posh init pwsh --config "C/Users/USERNAME/.mytheme.omp.json" | Invoke-Expression
  4. Reload the current profile via .$PROFILE

The user has custom configuration

  1. Edit the custom configuration and add {"auto_upgrade": true}
  2. Edit the $PROFILE file so it uses the new configuration file oh-my-posh init pwsh --config "C/Users/USERNAME/.mytheme.omp.json" | Invoke-Expression
  3. Reload the current profile via .$PROFILE

Possible enhancement

Would it make more sense to introduce a command such as oh-my-posh autoupgrade or equivalent that offers a uniform user experience when enabling auto upgrades?
Some possible issues with this:

  • What if the user didn't have a custom configuration yet, should it be created automatically based upon the current theme?
  • Could the oh-my-posh upgrade configuration be handled separately from the theming configuration, e.g. in a different file?

Would love to see if this could be viable a UX improvement, however I might have overlooked a few things here due to my limited experience with the custom configuration file.

@jefmeijvis jefmeijvis added the 🤩 enhancement Improvement of a feature label Oct 11, 2024
@JanDeDobbeleer
Copy link
Owner

@jefmeijvis this can definitely work. It's easy to use the machine cache to set this in and enable using oh-my-posh enable autoupgrade

@darkred
Copy link

darkred commented Oct 13, 2024

@JanDeDobbeleer Could oh-my-posh enable autoupgrade be included in the Upgrade documentation page for reference?

@JanDeDobbeleer
Copy link
Owner

@darkred yes, coming as part of the next major

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤩 enhancement Improvement of a feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants