Skip to content

Commit

Permalink
Fix terminal-notifier Bundler issue
Browse files Browse the repository at this point in the history
Fixes issue alexch#108

`which` is used to determine if terminal-notifier can run, but then it’s run inside a Bundler environment where terminal-notifier may not exist in the Gemfile.  This then results in:

/gems/bundler-1.12.5/lib/bundler/rubygems_integration.rb:322:in `block in replace_gem': terminal-notifier is not part of the bundle. Add it to Gemfile. (Gem::LoadError)
	from /gems/ruby-2.2.5/bin/terminal-notifier:22:in `<main>'
	from /gems/ruby-2.2.5/bin/ruby_executable_hooks:15:in `eval'
	from /gems/ruby-2.2.5/bin/ruby_executable_hooks:15:in `<main>'
  • Loading branch information
mattheworiordan committed Oct 20, 2016
1 parent 3e4c486 commit 3347aa1
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion lib/rerun/notification.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ def command_named(name)

def send(background = true)
return unless command
`#{command}#{" &" if background}`
with_clean_env do
`#{command}#{" &" if background}`
end
end

def app_name
Expand All @@ -60,5 +62,14 @@ def icon_dir
File.expand_path("#{here}/../../icons")
end

def with_clean_env
if defined?(Bundler)
Bundler.with_clean_env do
yield
end
else
yield
end
end
end
end

0 comments on commit 3347aa1

Please sign in to comment.