r-darwish / topgrade

Upgrade everything
GNU General Public License v3.0
3.37k stars 162 forks source link

How to disable some steps via config file? #1008

Open mouse07410 opened 1 year ago

mouse07410 commented 1 year ago

Environment

I want another step added

Specifically, to update Haskell stuff. Something like

ghcup upgrade
ghcup install hls
cabal update

I want to suggest some general feature

Topgrade should allow automatically skipping steps that user specifies in the top grade config file.

For example, I don't want "topgrade" to check or perform system update, and I don't want it to update NPM.

disable ["system", "npm", "bin"] did not help - "topgrade" still tried all of the above (some of which necessarily failed).

More information

stefanhusmann commented 1 year ago

This is supported, but you need to be careful. disable ["system", "node"] should work, but "npm" is the wrong keyword, and "bin" is not defined at all (btw., what should it do)?

mouse07410 commented 1 year ago

and "bin" is not defined at all (btw., what should it do)?

"bin" shouldn't do anything, but on my system it was trying to locate file $HOME/bin/bin and execute it, then complaining when it's not found. It also created a dummy/bad $HOME/bin/bin. I promptly deleted it, and added "bin" to "exclude" - which remedied the problem. And, of course "npm" is referred to as "node" (which was not obvious to me).

Here's what my current config has (BTW, it would be nice if topgrade offered the flag to just display the current config, without changing/editing it):

.  .  .
disable = ["system", "node", "containers", "bin", "vcpkg"]
.  .  .
[commands]
#"Python Environment" = "~/dev/.env/bin/pip install -i https://pypi.python.org/simple -U --upgrade-strategy eager jupyter"
"Haskell" = "ghcup upgrade && ghcup install hls && stack update && cabal update && hoogle generate"

Anyway, now it seems to work, thank you for a nice package.