Commit a49d2f70 authored by Samuel Giddins's avatar Samuel Giddins

[HeadersStore] mkpath less

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