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

Pass invocation parameters to custom commands #1050

Open
Laura7089 opened this issue Feb 27, 2025 · 1 comment
Open

Pass invocation parameters to custom commands #1050

Laura7089 opened this issue Feb 27, 2025 · 1 comment
Labels
C-feature request New feature request

Comments

@Laura7089
Copy link
Contributor

Laura7089 commented Feb 27, 2025

It would be a convenient feature if topgrade informed the {pre_,,post_}commands scripts of the configuration topgrade was invoked with.

My initial thoughts are environment variables like TOPGRADE_CLEAN=1 and TOPGRADE_ACCEPT_ALL=1 for the clean = true config option and -y CLI flag respectively.

My motivation for this is primarily that I have a couple of custom commands which implement cleaning processes that probably shouldn't be upstreamed into topgrade itself since they're quite opinionated. For example:

  • I clean out all automatically-installed packages which no longer have any dependents
  • I clean podman storage with podman prune -af.

I'd like to make these "steps" conditional on the clean config option.

@Laura7089 Laura7089 added the C-feature request New feature request label Feb 27, 2025
@Laura7089
Copy link
Contributor Author

I'm happy to PR this feature myself, but I wanted to hear maintainer thoughts first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-feature request New feature request
Projects
None yet
Development

No branches or pull requests

1 participant