diff options
author | Andre Arko <andre@arko.net> | 2014-04-13 15:10:43 -0700 |
---|---|---|
committer | Andre Arko <andre@arko.net> | 2014-04-13 15:11:11 -0700 |
commit | 9748e092d540d693c6a1b3d08c60658fd1af34c8 (patch) | |
tree | e74077c6614d18e596e2a0ec70bebff44feb3af1 | |
parent | b7a6f3c8dde4abc099f82446ec8b89b28cf2f0d3 (diff) | |
download | bundler-9748e092d540d693c6a1b3d08c60658fd1af34c8.tar.gz |
good error when caching path that's deleted
-rw-r--r-- | lib/bundler/source/path.rb | 5 |
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")) |