buo / homebrew-cask-upgrade

A command line tool for upgrading every outdated app installed by Homebrew Cask
MIT License
2.4k stars 90 forks source link

Added --report option #140

Closed armccoy closed 4 years ago

armccoy commented 4 years ago

Adding the -r or --report option returns a list of outdated apps, then quits without performing an update. Can be used in conjunction with the -f and -a options.

ondrejfuhrer commented 4 years ago

Hey @armccoy , thank you for your contribution. Can you please clarify here what is the use-case here? I don't see much of a difference between that and then hitting N to not update anything (of course the user intervention is needed, but still).

If you want just a list of outdated apps, you can then use brew cask outdated and the the result, or is there a reason why that doesn't work for you?

armccoy commented 4 years ago

Hey @armccoy , thank you for your contribution. Can you please clarify here what is the use-case here? I don't see much of a difference between that and then hitting N to not update anything (of course the user intervention is needed, but still).

If you want just a list of outdated apps, you can then use brew cask outdated and the the result, or is there a reason why that doesn't work for you?

It's pretty much a scratch-my-own-itch addition. I wanted a report-only option that doesn't require additional user input. Basically, to be able to cron a script against it that runs brew cu -ar each morning and if updates are found, the script would send the output via email.

ondrejfuhrer commented 4 years ago

Basically, to be able to cron a script against it that runs brew cu -ar each morning and if updates are found, the script would send the output via email.

I just would like to be sure that this actually brings any benefit. If I understand your case correctly it would then be enough to run brew cask outdated --greedy --verbose | grep -v latest (the grep is there to exclude latest casks that are reported every time when --greedy is used) and check the result? Maybe that would be even easier for your script to do that? WDYT?

armccoy commented 4 years ago

If I understand your case correctly it would then be enough to run brew cask outdated --greedy --verbose | grep -v latest (the grep is there to exclude latest casks that are reported every time when --greedy is used) and check the result? Maybe that would be even easier for your script to do that? WDYT?

Thanks, Ondřej! That is literally exactly what I needed and was trying to replicate with the -r option. Feel free to disregard my pull request if you'd prefer. And thanks also for brew cu! I've passed it on to a couple of my coworkers who are now using it regularly.

ondrejfuhrer commented 4 years ago

Happy to help and thank you for your contribution. Even though we don't need this one, it is always nice to see that there are people willing to help keep this project alive 🙂