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

Detect installation method when suggesting an upgrade #16

Open
mszostok opened this issue Jul 31, 2022 · 2 comments
Open

Detect installation method when suggesting an upgrade #16

mszostok opened this issue Jul 31, 2022 · 2 comments
Labels
area/integration Integration with external libs

Comments

@mszostok
Copy link
Owner

mszostok commented Jul 31, 2022

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
@mszostok mszostok added the area/integration Integration with external libs label Jul 31, 2022
@mszostok mszostok changed the title Detect installation method when suggest upgrade Detect installation method when suggesting an upgrade Aug 3, 2022
@Kamsiy
Copy link
Contributor

Kamsiy commented Dec 18, 2022

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

@mszostok
Copy link
Owner Author

mszostok commented Dec 19, 2022

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 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/integration Integration with external libs
Projects
Status: No status
Development

No branches or pull requests

2 participants