summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndre Arko <andre@arko.net>2014-04-01 16:31:26 +0800
committerAndre Arko <andre@arko.net>2014-04-01 16:31:26 +0800
commit447f7eed5405e2adec5dc7d8d5cd7d74bee2d6e7 (patch)
tree4bcfdfff70b0fbdb298d100fac65f7799a7eaed3
parent5a37299c1db5181063b178874d9e91f73f97f8d0 (diff)
downloadbundler-447f7eed5405e2adec5dc7d8d5cd7d74bee2d6e7.tar.gz
only copy files that exist
-rw-r--r--lib/bundler/source/rubygems.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/bundler/source/rubygems.rb b/lib/bundler/source/rubygems.rb
index 962b3f783c..ce40cbc6c3 100644
--- a/lib/bundler/source/rubygems.rb
+++ b/lib/bundler/source/rubygems.rb
@@ -100,8 +100,10 @@ module Bundler
# SUDO HAX
if Bundler.requires_sudo?
Bundler.rubygems.repository_subdirectories.each do |name|
- Bundler.mkdir_p File.join(Bundler.rubygems.gem_dir, name)
- Bundler.sudo "cp -R #{install_path}/#{name}/* #{Bundler.rubygems.gem_dir}/#{name}/"
+ src = "#{install_path}/#{name}/*"
+ dst = "#{Bundler.rubygems.gem_dir}/#{name}/"
+ Bundler.mkdir_p dist
+ Bundler.sudo "cp -R #{src} #{dst}" if Dir[src].any?
end
spec.executables.each do |exe|