summaryrefslogtreecommitdiff
path: root/lib/bundler/runtime.rb
diff options
context:
space:
mode:
authorAgis Anastasopoulos <agis.anast@gmail.com>2015-09-26 16:09:36 +0300
committerAgis Anastasopoulos <agis.anast@gmail.com>2015-09-27 16:54:11 +0300
commite6e1ff5953e5713fbdd7c2664ed785b426bea827 (patch)
treec550268658546d5f4a604abe242f00587f990e04 /lib/bundler/runtime.rb
parent643a57c91a0d1e33ebc37bd8656f9e8d5a3749a6 (diff)
downloadbundler-e6e1ff5953e5713fbdd7c2664ed785b426bea827.tar.gz
Wrap filesystem operations with #filesystem_access
Diffstat (limited to 'lib/bundler/runtime.rb')
-rw-r--r--lib/bundler/runtime.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/bundler/runtime.rb b/lib/bundler/runtime.rb
index d0b81d6624..b214ebc988 100644
--- a/lib/bundler/runtime.rb
+++ b/lib/bundler/runtime.rb
@@ -110,7 +110,9 @@ module Bundler
def cache(custom_path = nil)
cache_path = Bundler.app_cache(custom_path)
- FileUtils.mkdir_p(cache_path) unless File.exist?(cache_path)
+ SharedHelpers.filesystem_access(cache_path) do |p|
+ FileUtils.mkdir_p(p)
+ end unless File.exist?(cache_path)
Bundler.ui.info "Updating files in #{Bundler.settings.app_cache_path}"
specs.each do |spec|
@@ -128,7 +130,9 @@ module Bundler
end
def prune_cache(cache_path)
- FileUtils.mkdir_p(cache_path) unless File.exist?(cache_path)
+ SharedHelpers.filesystem_access(cache_path) do |p|
+ FileUtils.mkdir_p(p)
+ end unless File.exist?(cache_path)
resolve = @definition.resolve
prune_gem_cache(resolve, cache_path)
prune_git_and_path_cache(resolve, cache_path)