diff options
Diffstat (limited to 'lib/bundler/cli/open.rb')
-rw-r--r-- | lib/bundler/cli/open.rb | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/lib/bundler/cli/open.rb b/lib/bundler/cli/open.rb index 8522ec92d6..f24693b843 100644 --- a/lib/bundler/cli/open.rb +++ b/lib/bundler/cli/open.rb @@ -18,13 +18,11 @@ module Bundler Bundler.ui.info "Unable to open #{name} because it's a default gem, so the directory it would normally be installed to does not exist." else root_path = spec.full_gem_path - Dir.chdir(root_path) do - require "shellwords" - command = Shellwords.split(editor) << File.join([root_path, path].compact) - Bundler.with_original_env do - system(*command) - end || Bundler.ui.info("Could not run '#{command.join(" ")}'") - end + require "shellwords" + command = Shellwords.split(editor) << File.join([root_path, path].compact) + Bundler.with_original_env do + system(*command, { chdir: root_path }) + end || Bundler.ui.info("Could not run '#{command.join(" ")}'") end end end |