homebrew-cask-upgrade
homebrew-cask-upgrade copied to clipboard
Add a config for default behaviour
As a user I would like to set a default behaviour to brew cu command. As an example I might wan't to always run it with --all option.
Desired flow:
> brew cu
==> Options
Include auto-update (-a): false
Include latest (-f): false
Config change
> brew cu config set auto-update true
Option "auto-update" has been set to "true" by default.
> brew cu
==> Options
Include auto-update (-a): true
Include latest (-f): false
Options overview:
brew cu config set KEY VALUE- sets a certain value to the keybrew cu config reset KEY- resets certain key to a default statebrew cu config reset- resets all keys to a default statebrew cu config list- prints all configsbrew cu --ignore-config- runningbrew cucommand in a default state (as there are no configs set)
Available keys:
auto-update- if auto-update apps should be updatedlatest- if "latest" apps should be updatedinteractive- always run the upgrade as interactiveforce-yes- always update all the apps (no interaction needed)
what about a dotfile like .brewcu config file (in current dir and in your ~/ home dir
there i can set all options with like on command line
i would also expect only this new commands:
brew cu -f ./current_config_file
brew cu --ignore-config
order:
1 command line options
2 ./.brewcu
3 ~/.brewcu
Hey @muescha , thank you very much for your feedback! I really appreciate that.
It would anyways use a dotfile (or some sort of config file in the home dir) to store those options, so what you are suggesting is very much possible. And true that probably the implementation would be much easier and adding the manipulation through brew cu config commands can be added later on.
Regarding the order: Do you see a use case where you would like to have a different behaviour based on the execution context? Wouldn't that bee too confusing?
brew cu -f ./current_config_file
Also do you see a valid use case here, having multiple settings?
PS: -f is already taken, therefore it would be more likely -c and --config
i was just thinking in general about commands and their .dotfiles and where i expect it to read from which places and in which order.
Do you see a use case where you would like to have a different behaviour based on the execution context? Wouldn't that bee too confusing?
you are right we can remove that 2 ./.brewcu
brew cu -f ./current_config_file
Also do you see a valid use case here, having multiple settings?
maybe in a ci environment or something like this but you are sure i don't know where it is needed
should the pinned file also go somewhere here near the .brew-cu ... maybe in as a .brew-cu-ignore file?
@muescha I was also thinking about it and the "issue" I have with it is that this gets not cleaned after uninstalling. The cu command configuration is fine to be "persistent", it is basically a saved preference how you want to use it, but pinned info is more about a state. Therefore when you uninstall the tap the state should be removed as well, what do you think?
but if someone save his ".dotfiles" maybe he like to remember all the pinned files also. so i expect it there and not in a "magic" hidden folder 🤔
but i think thats can be done in a different PR and not for this change... sorry for highjacking this PR with the idea