Commit eeb05df6 authored by Samuel E. Giddins's avatar Samuel E. Giddins

[Downloader::Cache] #mkpath === mkdir_p

parent 6fbae5a7
...@@ -17,7 +17,7 @@ module Pod ...@@ -17,7 +17,7 @@ module Pod
# #
def initialize(root) def initialize(root)
@root = Pathname(root) @root = Pathname(root)
@root.mkpath unless @root.exist? @root.mkpath
end end
# Downloads the Pod from the given `request` # Downloads the Pod from the given `request`
...@@ -163,7 +163,7 @@ module Pod ...@@ -163,7 +163,7 @@ module Pod
spec.available_platforms.each do |platform| spec.available_platforms.each do |platform|
specs_by_platform[platform] = [spec, *spec.recursive_subspecs].select { |ss| ss.supported_on_platform?(platform) } specs_by_platform[platform] = [spec, *spec.recursive_subspecs].select { |ss| ss.supported_on_platform?(platform) }
end end
destination.parent.mkpath unless destination.parent.exist? destination.parent.mkpath
FileUtils.cp_r(source, destination) FileUtils.cp_r(source, destination)
Sandbox::PodDirCleaner.new(destination, specs_by_platform).clean! Sandbox::PodDirCleaner.new(destination, specs_by_platform).clean!
end end
...@@ -179,7 +179,7 @@ module Pod ...@@ -179,7 +179,7 @@ module Pod
# @return [Void] # @return [Void]
# #
def write_spec(spec, path) def write_spec(spec, path)
FileUtils.mkdir_p path.dirname path.dirname.mkpath
path.open('w') { |f| f.write spec.to_pretty_json } path.open('w') { |f| f.write spec.to_pretty_json }
end end
end end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment