Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

Commit

Permalink
Don't raise when unable to write env.rb
Browse files Browse the repository at this point in the history
  • Loading branch information
indirect committed Apr 23, 2010
1 parent ecf81a6 commit e991f99
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions lib/bundler/environment.rb
Expand Up @@ -92,13 +92,17 @@ def locked?
end

def write_rb_lock
env_file = Bundler.default_gemfile.dirname.join(".bundle/environment.rb")
env_file.dirname.mkpath
File.open(env_file, 'w') do |f|
f.puts <<-RB
require "rubygems"
require "bundler/setup"
RB
begin
env_file = Bundler.default_gemfile.dirname.join(".bundle/environment.rb")
env_file.dirname.mkpath
File.open(env_file, 'w') do |f|
f.puts <<-RB
require "rubygems"
require "bundler/setup"
RB
end
rescue Errno::EACCES
Bundler.ui.warn "Cannot write .bundle/environment.rb file"
end
end

Expand Down

0 comments on commit e991f99

Please sign in to comment.