diff options
author | Andre Arko <andre@arko.net> | 2010-04-18 10:38:48 -0700 |
---|---|---|
committer | Andre Arko <andre@arko.net> | 2010-04-23 09:58:16 -0700 |
commit | e48d96c9f41cda52375d244c9f6903afd05e3189 (patch) | |
tree | 9153666db691e87dff52e9750ab3a0c255f689a2 /lib | |
parent | 4673e128c8b1ba68deaec57f956286b420f267ff (diff) | |
download | bundler-e48d96c9f41cda52375d244c9f6903afd05e3189.tar.gz |
Don't try to remove a built gem unless it exists
Diffstat (limited to 'lib')
-rw-r--r-- | lib/bundler/source.rb | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/lib/bundler/source.rb b/lib/bundler/source.rb index 960a154d..e08e195a 100644 --- a/lib/bundler/source.rb +++ b/lib/bundler/source.rb @@ -271,11 +271,7 @@ module Bundler def generate_bin(spec) gem_dir = spec.full_gem_path - gem_file = nil # so we have access after it's set in the block - - Dir.chdir(gem_dir) do - gem_file = Gem::Builder.new(spec).build - end + gem_file = Dir.chdir(gem_dir){ Gem::Builder.new(spec).build } installer = Gem::Installer.new File.join(gem_dir, gem_file), :bin_dir => "#{Gem.dir}/bin", @@ -300,7 +296,7 @@ module Bundler Bundler.ui.warn "The validation message from Rubygems was:\n #{e.message}" ensure - Dir.chdir(gem_dir){ FileUtils.rm_rf(File.join(gem_dir, gem_file)) } + Dir.chdir(gem_dir){ FileUtils.rm_rf(gem_file) if gem_file && File.exist?(gem_file) } end end |