Commit a49d2f70 authored by Samuel Giddins's avatar Samuel Giddins

[HeadersStore] mkpath less

parent 742e7dab
...@@ -54,7 +54,7 @@ module Pod ...@@ -54,7 +54,7 @@ module Pod
return @search_paths_cache[key] if @search_paths_cache.key?(key) return @search_paths_cache[key] if @search_paths_cache.key?(key)
search_paths = @search_paths.select do |entry| search_paths = @search_paths.select do |entry|
matches_platform = entry[:platform] == platform.name matches_platform = entry[:platform] == platform.name
matches_target = target_name.nil? || (entry[:path].basename.to_s == target_name) matches_target = target_name.nil? || (File.basename(entry[:path]) == target_name)
matches_platform && matches_target matches_platform && matches_target
end end
headers_dir = root.relative_path_from(sandbox.root).dirname headers_dir = root.relative_path_from(sandbox.root).dirname
...@@ -98,7 +98,7 @@ module Pod ...@@ -98,7 +98,7 @@ module Pod
def add_files(namespace, relative_header_paths) def add_files(namespace, relative_header_paths)
root.join(namespace).mkpath unless relative_header_paths.empty? root.join(namespace).mkpath unless relative_header_paths.empty?
relative_header_paths.map do |relative_header_path| relative_header_paths.map do |relative_header_path|
add_file(namespace, relative_header_path) add_file(namespace, relative_header_path, :mkdir => false)
end end
end end
...@@ -116,9 +116,9 @@ module Pod ...@@ -116,9 +116,9 @@ module Pod
# #
# @return [Pathname] # @return [Pathname]
# #
def add_file(namespace, relative_header_path, directory_made: false) def add_file(namespace, relative_header_path, mkdir: true)
namespaced_path = root + namespace namespaced_path = root + namespace
namespaced_path.mkpath unless directory_made namespaced_path.mkpath if mkdir
absolute_source = (sandbox.root + relative_header_path) absolute_source = (sandbox.root + relative_header_path)
source = absolute_source.relative_path_from(namespaced_path) source = absolute_source.relative_path_from(namespaced_path)
...@@ -129,7 +129,7 @@ module Pod ...@@ -129,7 +129,7 @@ module Pod
# Adds an header search path to the sandbox. # Adds an header search path to the sandbox.
# #
# @param [Pathname] path # @param [Pathname] path
# the path tho add. # the path to add.
# #
# @param [String] platform # @param [String] platform
# the platform the search path applies to # the platform the search path applies to
...@@ -137,7 +137,7 @@ module Pod ...@@ -137,7 +137,7 @@ module Pod
# @return [void] # @return [void]
# #
def add_search_path(path, platform) def add_search_path(path, platform)
@search_paths << { :platform => platform.name, :path => (Pathname.new(@relative_path) + path) } @search_paths << { :platform => platform.name, :path => File.join(@relative_path, path) }
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