topgrade icon indicating copy to clipboard operation
topgrade copied to clipboard

Intelligently-enabled custom commands

Open 9999years opened this issue 1 year ago • 2 comments

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 avatar Feb 08 '24 04:02 9999years

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.

9999years avatar Feb 08 '24 04:02 9999years

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:)

SteveLauC avatar Feb 09 '24 01:02 SteveLauC