DomT4 / homebrew-autoupdate

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

Add start/end notification? #5

Closed chadrien closed 7 years ago

chadrien commented 8 years ago

Hi,

Just an idea that came to my mind after I got a env: node: No such file or directory error caused by homebrew selfupdating in the background. At first I was like "the heck node doesn't work anymore?". It's only after thinking about it that I remembered that I just started my mac and then the autoupdate should be running, upgrading the version of node, hence node not being available during upgrade.

So here's the idea: why not having a system notification (that can be switched on/off) for distracted people like me that would say something like "hey homebrew autoupdate started!" and "Yay homebrew update done!". If you're OK with the idea I could try to implement it and submit it as a PR.

DomT4 commented 8 years ago

Hey @chadrien, I'd be fine with this, a couple of others proposed the idea before and I agreed it'd be handy.

I'd thought about it a bit but hadn't got around to deciding whether using osascript to throw a notification like this or introducing a dependency on terminal-notifier is the more sane route to go down. The former method works on 10.9 & above, not sure about the latter.

chadrien commented 8 years ago

After a quick reading and experimentation, here the main pros/cons

AppScript:

terminal-notifier:

Regarding terminal-notifier support, from their readme:

OS X 10.8 and higher.

So what's your opinion?

Also I just thought about this: if the --upgrade option was given, maybe we could try to list the upgraded packages in the notification.

DomT4 commented 7 years ago

Better late than never I guess, but I've started the ball rolling on this in https://github.com/DomT4/homebrew-autoupdate/commit/aa38e5b3e3363bb35ae984351eb70d80faad106b & https://github.com/DomT4/homebrew-autoupdate/commit/9b2211751098b799a8ffa3c0a3d3ffcdf0a94083. There's potential room for expansion going forwards, but as I try to do the commit messages go into my thought process and upsides/downsides quite a bit.

chadrien commented 7 years ago

👍👌🎉