Formulae that require user intervention cause Brewlet to update forever
Some Homebrew formulae (casks) require CLI intervention when upgrading (for example, I am aware of dotnet-sdk, virtualbox and vagrant). Their installers require the administrator password in order to uninstall/reinstall components.
When these are installed on a system, Brewlet will still run an update, but will endlessly show that it is updating because these prompts are never shown or responded to.
Not sure what the best option might be for handling these.
virtualbox does not always require admin password; powershell is another cask install that does.
Found another one (1password-cli)
I think running brew upgrade --formulae would mean that only the non-casks would be upgraded, so this might be a workaround here.
It's correct that brew upgrade --formulae only upgrades the non-Casks. So, given that more than a few Casks do require intervention and an admin / user password to be entered, on option here might be:
- change the operation of "Upgrade" to run
brew upgrade --formulae- optionally, afterwards, prompt the user to upgrade casks from the CLI (if there are still packages waiting to be upgraded)
Thoughts?
Thanks so much for bringing this up and offering solutions. I aim to dig into this sometime within this week. I wonder if there is a flag in a formula that indicates whether super user permission are required—I'll look for it. I think restricting upgrades to formulae is a fine solution otherwise, especially since many casks update themselves outside of brew anyways.
Didn't find any flags in info --json=v2 that reliably indicate whether an upgrade requires interaction. I decided to add a preference that you can toggle that switches between brew upgrade and brew upgrade --formula. Feel free to test it and let me know how it works. I'll also test it in the meantime and will merge when it's ready. New branch created for this change: https://github.com/zkokaja/Brewlet/commit/0bfe3ad5a13d81101d408b8963c52cad0ddb0ad2
Somehow I think it is losing the actual brew command when this is run with "do not upgrade casks" set - I get an error in the log saying Error: Unknown command: upgrade --formula (note how it is missing the path to the brew command itself.
Ah that's strange, I'll take a look! Thank you
Added a fix and tested that it works for formulae! Now waiting for one my casks to be outdated and I'll test whether it ignores it as it should. New commit: c90f1da21a99f333e6ad845e4e6eaa8f4142f13e
Yep - working great for me now. Thank you!