DomT4 / homebrew-autoupdate

:tropical_drink: An easy, convenient way to automatically update Homebrew.
BSD 2-Clause "Simplified" License
987 stars 54 forks source link

Add --greedy argument #81

Closed erikw closed 2 years ago

erikw commented 2 years ago

--greedy cask upgrade is now opt-in instead of mandatory.

Fixes #58

Testing

I'm not sure how to properly test this. This is what I did

  1. Switch to my branch in the system's brew tap
    $ cd "$(brew --repository homebrew/homebrew-autoupdate)"
    $ git remote add erikw git@github.com:erikw/homebrew-autoupdate.git
    $ git fetch erikw
    $ git checkout opt-in-greedy
  2. In lib/autoupdate/start.rb I added a little argument logger here of what will be executed:
      File.open("/tmp/start.rb.log", "a") do |f|
        f.write auto_args
      end
  3. Enable the autoupdate with and without the --greedy
    $ brew autoupdate start 5 --upgrade
    $ brew autoupdate stop
    $ brew autoupdate start 5 --upgrade --greedy
  4. View the captured auto_args in /tmp/start.rb.log:
    update && /usr/local/bin/brew upgrade --formula -v && /usr/local/bin/brew upgrade --cask -v && /usr/bin/open -g /usr/local/Homebrew/Library/Taps/homebrew/homebrew-autoupdate/notifier/brew-autoupdate.app
    update && /usr/local/bin/brew upgrade --formula -v && /usr/local/bin/brew upgrade --cask -v --greedy && /usr/bin/open -g /usr/local/Homebrew/Library/Taps/homebrew/homebrew-autoupdate/notifier/brew-autoupdate.app
    

So... it seems to work...


Before we can merge this, it would be good to:

DomT4 commented 2 years ago

This was pretty solid to start with. Only things that are slight oddities of this repo/Homebrew's style: Double quotes for almost everything instead of single, and for this tap if you update the version number in /lib/autoupdate/version.rb and name the commit version: bump to it automatically generates a changelog when people check brew autoupdate version.

Sorry this was something I didn't get around to myself, I work far too much these days which has made the stability of this side project something I'm very grateful for but also means I haven't had time to work on new features/changes/etc all that much. Really helps when people like yourself @erikw pick things up, so thank you, I appreciate it.

erikw commented 2 years ago

Thank you. I missed the coding style

Really helps when people like yourself @erikw pick things up, so thank you, I appreciate it.

This is what open source & GitHub is about 😀