Detect installation method when suggesting an upgrade
Description
Add option to detect if CLI was installed via
- Homebrew
- apt
- krew
- choco
so later the ready to copy-paste command is displayed in upgrade notice, e.g.:
A new release is available: v0.6.1 -> v0.7.4
To upgrade, run: brew upgrade gimme
https://github.com/mszostok/gimme
This would be really cool! What are your thoughts on allowing developers to configure the upgrade command instead of detecting it?
...
// Example
command := "brew upgrade --without-npm gimme"
upgradeOpts := []upgrade.Options{
upgrade.WithLayout(&style.Layout{
GoTemplate: forBoxLayoutGoTpl,
}),
upgrade.WithPostRenderHook(SprintInBox),
upgrade.WithCommand(command)
}
// displayed output
A new release is available: v0.6.1 -> v0.7.4
To upgrade, run: brew upgrade --without-npm gimme
https://github.com/mszostok/gimme
Adding that shouldn't be a problem 🤔 and it makes sens in some cases 👍
But the only problem is that a single binary can be installed in different ways. For example, k3d: https://k3d.io/v5.4.6/#releases where you can manually download it from GitHub release, or use Homebrew, or Chocolatey.
so if someone will “hard-coded” that in their binary, it can be less useful. Maybe only if they will build a dedicated binary per "release" source 🤔