Skip to content

Conversation

kylewlacy
Copy link
Member

This PR introduces a new internal subcommand: brioche self-post-install. Currently, when called, it just prints a simple message:

Brioche v{CURRENT_VERSION} is now installed

This PR also updates the self-update subcommand to call brioche self-post-install on the newly-installed version. Since this command just prints a message, this doesn't do much today, but it does at least validate that the new version is working as expected (or prints a warning with some tips if the command fails... which could be a sign that something is very broken).

Of course, this doesn't provide much value today. But my hope is that the new self-update process (part of #281) can last well into the future, so this gives us a place to hook into for things like migrations or one-off cleanup tasks when going from older versions to newer versions. The benefit of doing this now is that future versions can always assume that the self-post-install command is called during the update process.

When calling self-post-install, the self-updater sets 2 extra env vars:

  • BRIOCHE_SELF_POST_INSTALL_SOURCE=self-update (so the post-install step can tell apart e.g. a new install vs. an update)
  • BRIOCHE_SELF_POST_INSTALL_PREVIOUS_VERSION (set to the version doing the self-update, so the post-install step can do different things depending on what version we're coming from)

@kylewlacy kylewlacy merged commit a54d62c into main Oct 11, 2025
10 checks passed
@kylewlacy kylewlacy deleted the self-post-install branch October 11, 2025 06:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant