diff --git a/Ruby/lib/terminal_notifier/guard/failed.rb b/Ruby/lib/terminal_notifier/guard/failed.rb index e45863d..be5af39 100644 --- a/Ruby/lib/terminal_notifier/guard/failed.rb +++ b/Ruby/lib/terminal_notifier/guard/failed.rb @@ -1,7 +1,11 @@ module TerminalNotifier module Guard module Failed - BIN_PATH = File.expand_path('../../../../vendor/terminal-notifier-failed.app/Contents/MacOS/terminal-notifier', __FILE__) + terminal_notifier_path = `which terminal-notifier` + BIN_PATH = terminal_notifier_path.empty? ? + File.expand_path('../../../../vendor/terminal-notifier-failed.app/Contents/MacOS/terminal-notifier', __FILE__) + : + terminal_notifier_path end end end diff --git a/Ruby/lib/terminal_notifier/guard/notify.rb b/Ruby/lib/terminal_notifier/guard/notify.rb index 86d1c4f..1619a7e 100644 --- a/Ruby/lib/terminal_notifier/guard/notify.rb +++ b/Ruby/lib/terminal_notifier/guard/notify.rb @@ -1,7 +1,11 @@ module TerminalNotifier module Guard module Notify - BIN_PATH = File.expand_path('../../../../vendor/terminal-notifier-notify.app/Contents/MacOS/terminal-notifier', __FILE__) + terminal_notifier_path = `which terminal-notifier` + BIN_PATH = terminal_notifier_path.empty? ? + File.expand_path('../../../../vendor/terminal-notifier-failed.app/Contents/MacOS/terminal-notifier', __FILE__) + : + terminal_notifier_path end end end diff --git a/Ruby/lib/terminal_notifier/guard/pending.rb b/Ruby/lib/terminal_notifier/guard/pending.rb index 8634741..771a493 100644 --- a/Ruby/lib/terminal_notifier/guard/pending.rb +++ b/Ruby/lib/terminal_notifier/guard/pending.rb @@ -1,7 +1,11 @@ module TerminalNotifier module Guard module Pending - BIN_PATH = File.expand_path('../../../../vendor/terminal-notifier-pending.app/Contents/MacOS/terminal-notifier', __FILE__) + terminal_notifier_path = `which terminal-notifier` + BIN_PATH = terminal_notifier_path.empty? ? + File.expand_path('../../../../vendor/terminal-notifier-failed.app/Contents/MacOS/terminal-notifier', __FILE__) + : + terminal_notifier_path end end end diff --git a/Ruby/lib/terminal_notifier/guard/success.rb b/Ruby/lib/terminal_notifier/guard/success.rb index b4cd9f0..9444a97 100644 --- a/Ruby/lib/terminal_notifier/guard/success.rb +++ b/Ruby/lib/terminal_notifier/guard/success.rb @@ -1,7 +1,11 @@ module TerminalNotifier module Guard module Success - BIN_PATH = File.expand_path('../../../../vendor/terminal-notifier-success.app/Contents/MacOS/terminal-notifier', __FILE__) + terminal_notifier_path = `which terminal-notifier` + BIN_PATH = terminal_notifier_path.empty? ? + File.expand_path('../../../../vendor/terminal-notifier-failed.app/Contents/MacOS/terminal-notifier', __FILE__) + : + terminal_notifier_path end end end