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

Add an install flag to not upgrade a package during upgrade --all #45

Open
tim-coutinho opened this issue Oct 9, 2024 · 2 comments
Open

Comments

@tim-coutinho
Copy link

I'd like the ability to have a package installed via stew not be auto-upgraded during stew upgrade --all. In my case, the package in question (topgrade) has a self-upgrading feature built into it, which I'd rather use over stew. It seems like the upgrade candidates are determined by the lockfile, so I'm guessing this would just be a matter of changing this else to an else if <don't upgrade flag not specified>? I'd be happy to PR this, I've just never written Go in my life.

@marwanhawari
Copy link
Owner

Hey! This use case makes sense to me and I can imagine this being a configuration option in the stew.config.json. Maybe something like:

{
  "stewPath": "/Users/marwanhawari/.stew",
  "stewBinPath": "/Users/marwanhawari/.stew/bin",
  "excludeFromUpgradeAll": [
	"sharkdp/fd",
	"topgrade-rs/topgrade"
  ]
}

or skipDuringUpgradeAll.

You're right that we read the packages from the lockfile, this occurs here.

A few things to consider:

  1. We'll need to read from the config file during the upgrade.
  2. Config file is not guaranteed to exist.
  3. Even if the config file exists, this property won't be guaranteed to exist.
  4. We'd need to support configuring this option through the stew config command. Probably the most user-friendly UI would be a multi-select of packages you already have installed.

I don't have bandwidth to work on this right now, but if you wanna work on a PR, I can review and provide feedback!

@tim-coutinho
Copy link
Author

PR'd: #48

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

No branches or pull requests

2 participants