From 9748e092d540d693c6a1b3d08c60658fd1af34c8 Mon Sep 17 00:00:00 2001 From: Andre Arko Date: Sun, 13 Apr 2014 15:10:43 -0700 Subject: good error when caching path that's deleted --- lib/bundler/source/path.rb | 5 +++++ 1 file changed, 5 insertions(+) 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")) -- cgit v1.2.1