Skip to content

Instantly share code, notes, and snippets.

@ff6347
Forked from nimf/build-notifier.rb
Created September 26, 2016 11:14
Show Gist options
  • Select an option

  • Save ff6347/3217852315629d3da6440d716c3bc6bf to your computer and use it in GitHub Desktop.

Select an option

Save ff6347/3217852315629d3da6440d716c3bc6bf 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment