Implement command to self-update baur
baur should be able to update itself when a new version is available and replace, restart itself after the new version was downloaded.
To make it safe we must sign all releases via GPG and verify the signature after download versions.
The implementation could be similar to https://github.com/thought-machine/please/tree/master/src/update
Update: Evaluate if https://github.com/inconshreveable/go-update could be used
Why not registering the app into brew or using something like npm(JS), gem(Ruby) or pip(Python) which allow to install globally to the machine and update the package. Using npm, gem or pip requires a projects in the corresponding language which will serves as a bridge with the baur binary. It may be quite ridiculous but allow to download and update easily.
It's missing in my issue description, the main motivation was that when baur is updated to a newer version there are often git-branches around that still needs to be build in CI with the previous baur version.
Idea was to specify the baur version in the .baur.toml file and on startup baur would automatically downgrade/upgrade itself and run the specified version.
Currently we are doing the same in our CI setup with some bash scripts that ensure the fitting baur version is downloaded + executed.
Another solution would be to simply run baur from docker images in CI and have the docker image reference specified in the branch.
Often package managers (dpkg, pacman) install packages system wide and only support a limited number of versions for a package. This does not work together with being able to run multiple baur version on the same machine. Doing the update by baur itself is more simple to use. The baur installation is also so simple (copy binary to $PATH) that it does not seem to be worth to create and maintain packages additionally.
Oh yes ok I understand, you want to make something like sdkman which will handle all Baur versions behind the scene and automatically depending of the baur_version line in the .baur.toml (no need to config_version = x anymore with that so).