git-dude
git-dude copied to clipboard
Add OS X Notification Center notification backend support
Pull Request #30 added support for OS X Notification Center (OS X 10.8 Mountain Lion and newer) using terminal-notifier. Unfortunately, it also added GitHub-specific support, so was not accepted, but the OS X Notification Center support would be a nice addition.
Feel free to send a pull-request then :)
FWIW, I was able to accomplish this via the following (no external packages):
git config --global dude.notify-command 'osascript -e "display notification \"$DESCRIPTION\" with title \"$TITLE\""'
We have 2 options then:
- add osascript support to the code,
- or document the above example in the readme
I believe the osascript
support for notifications was added in OS X Mavericks. terminal-notifier
or Growl would still be necessary for earlier versions of OS X.
Using git config
per @joshdick didn't work for me, not sure what's up, getting a "Service exited with abnormal code" in the logs when I run this as a LaunchAgent daemon...
@digitaljhelms Which version of OS X are you using? This has worked fine for me on both Yosemite and El Capitan.
@joshdick El Capitan (10.11.1)
Command line failure: 732:742: syntax error: A identifier can’t go after this “"”. (-2740)
I walked through a few repos symlinked in ~/.git-dude
and ran git dude
manually until I found the repo causing the error. While, I don't know the specific commit that's the culprit, I can speculate it has something to do with a double quote in the description or title that, if not escaped before being passed to the osascript
command, causes the error... Perhaps working an escaping solution into the notify command (something like http://stackoverflow.com/a/23923108) would resolve this.