diff --git a/lib/rerun/notification.rb b/lib/rerun/notification.rb index 6663d47..06bc722 100644 --- a/lib/rerun/notification.rb +++ b/lib/rerun/notification.rb @@ -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 @@ -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