Skip to content

Commit

Permalink
[rubygems/rubygems] Use mkdir_p helper in bundler.rb
Browse files Browse the repository at this point in the history
Small refactor, no functional change

rubygems/rubygems@5edb7a1026
  • Loading branch information
segiddins authored and matzbot committed Dec 15, 2023
1 parent 474b4c4 commit 5a66ea2
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions lib/bundler.rb
Expand Up @@ -100,9 +100,7 @@ def bundle_path
end

def create_bundle_path
SharedHelpers.filesystem_access(bundle_path.to_s) do |p|
mkdir_p(p)
end unless bundle_path.exist?
mkdir_p(bundle_path) unless bundle_path.exist?

@bundle_path = bundle_path.realpath
rescue Errno::EEXIST
Expand All @@ -119,7 +117,7 @@ def bin_path
@bin_path ||= begin
path = settings[:bin] || "bin"
path = Pathname.new(path).expand_path(root).expand_path
SharedHelpers.filesystem_access(path) {|p| FileUtils.mkdir_p(p) }
mkdir_p(path)
path
end
end
Expand Down Expand Up @@ -483,7 +481,7 @@ def use_system_gems?
configured_bundle_path.use_system_gems?
end

def mkdir_p(path, options = {})
def mkdir_p(path)
SharedHelpers.filesystem_access(path, :write) do |p|
FileUtils.mkdir_p(p)
end
Expand Down

0 comments on commit 5a66ea2

Please sign in to comment.