Skip to content

Instantly share code, notes, and snippets.

@nimf
Forked from zoul/build-notifier.rb
Last active July 3, 2018 13:49
Show Gist options
  • Save nimf/8637eb8ba68f9134014b to your computer and use it in GitHub Desktop.
Save nimf/8637eb8ba68f9134014b to your computer and use it in GitHub Desktop.
Posts a message to the OS X notification center when a Jekyll build is finished. Requires TerminalNotifier, see http://git.io/5X99Eg or “gem install terminal-notifier”.
begin
require 'terminal-notifier'
module Jekyll
class Site
alias jekyll_process process
def process
jekyll_process
TerminalNotifier.notify("🍻 Jekyll rebuild finished")
rescue => e
TerminalNotifier.notify("💥 Jekyll rebuild failed: #{e.message}")
raise e
end
end
end
rescue LoadError
# nothing
end
@kerim
Copy link

kerim commented Dec 3, 2016

Please forgive a newbie question, but what do I do with the file build-notifier.rb? I understand that I need to install the gem terminal-notifier, but I'm not sure how to use the code you have here with that?

@johnpitchko
Copy link

Supposedly you install it in the _plugins/ directory, but I cannot get it to work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment