topgrade-rs / topgrade

Upgrade all the things
GNU General Public License v3.0
1.92k stars 124 forks source link

Intelligently-enabled custom commands #683

Open 9999years opened 7 months ago

9999years commented 7 months ago

Topgrade supports custom commands, like this:

[commands]
"Home Mangler" = "home-mangler --update --verbose"

Unfortunately, unlike the built-in steps, this command will always be run, and will fail if home-mangler isn't installed. As I often run Topgrade on various machines in varying states of disrepair, these sorts of failures are annoying.

It would be nice if I could require that a given command be installed:

[[commands]]
name = "Home Mangler"
requires = ["home-mangler"]
command = "home-mangler --update --verbose"

Then, the "Home Mangler" step would only run if there exists a home-mangler binary on the $PATH.

9999years commented 7 months ago

I may open a pull request for this at some point, but I'm interested to know if you think it's a good idea.

SteveLauC commented 7 months ago

Unfortunately, unlike the built-in steps, this command will always be run, and will fail if home-mangler isn't installed.

This is indeed something that custom commands can't handle

but I'm interested to know if you think it's a good idea.

This is a nice feature, love to see it in Topgrade:)