summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndre Arko <andre@arko.net>2014-04-13 15:10:43 -0700
committerAndre Arko <andre@arko.net>2014-04-13 15:11:11 -0700
commit9748e092d540d693c6a1b3d08c60658fd1af34c8 (patch)
treee74077c6614d18e596e2a0ec70bebff44feb3af1
parentb7a6f3c8dde4abc099f82446ec8b89b28cf2f0d3 (diff)
downloadbundler-9748e092d540d693c6a1b3d08c60658fd1af34c8.tar.gz
good error when caching path that's deleted
-rw-r--r--lib/bundler/source/path.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/bundler/source/path.rb b/lib/bundler/source/path.rb
index 8cde7dc2cd..c80ac61f46 100644
--- a/lib/bundler/source/path.rb
+++ b/lib/bundler/source/path.rb
@@ -78,6 +78,11 @@ module Bundler
app_cache_path = app_cache_path(custom_path)
return unless Bundler.settings[:cache_all]
return if expand(@original_path).to_s.index(Bundler.root.to_s) == 0
+
+ unless @original_path.exist?
+ raise GemNotFound, "Can't cache gem #{version_message(spec)} because #{to_s} is missing!"
+ end
+
FileUtils.rm_rf(app_cache_path)
FileUtils.cp_r("#{@original_path}/.", app_cache_path)
FileUtils.touch(app_cache_path.join(".bundlecache"))