Commit 2caeb0b4 authored by Fabio Pelosin's avatar Fabio Pelosin

[PathList|Analyzer] Minor bugs.

parent 4228ef59
...@@ -373,27 +373,26 @@ module Pod ...@@ -373,27 +373,26 @@ module Pod
# @return [Pathname] the path of the user project. # @return [Pathname] the path of the user project.
# #
def compute_user_project_path(target_definition) def compute_user_project_path(target_definition)
if target_definition.user_project_path if target_definition.user_project_path
user_project_path = Pathname.new(config.project_root + target_definition.user_project_path) path = config.project_root + target_definition.user_project_path
user_project_path = user_project_path.sub_ext '.xcodeproj' path = "#{path}.xcodeproj" unless File.extname(path) == '.xcodeproj'
unless user_project_path.exist? path = Pathname.new(path)
unless path.exist?
raise Informative, "Unable to find the Xcode project " \ raise Informative, "Unable to find the Xcode project " \
"`#{user_project_path}` for the target `#{target_definition.label}`." "`#{path}` for the target `#{target_definition.label}`."
end end
else else
xcodeprojs = Pathname.glob(config.project_root + '*.xcodeproj') xcodeprojs = Pathname.glob(config.project_root + '*.xcodeproj')
if xcodeprojs.size == 1 if xcodeprojs.size == 1
user_project_path = xcodeprojs.first path = xcodeprojs.first
else else
raise Informative, "Could not automatically select an Xcode project. " \ raise Informative, "Could not automatically select an Xcode project. " \
"Specify one in your Podfile like so:\n\n" \ "Specify one in your Podfile like so:\n\n" \
" xcodeproj 'path/to/Project.xcodeproj'\n" " xcodeproj 'path/to/Project.xcodeproj'\n"
end end
end end
path
user_project_path
end end
# Returns a list of the targets from the project of {TargetDefinition} # Returns a list of the targets from the project of {TargetDefinition}
......
...@@ -45,7 +45,7 @@ module Pod ...@@ -45,7 +45,7 @@ module Pod
def read_file_system def read_file_system
root_length = root.to_s.length+1 root_length = root.to_s.length+1
paths = Dir.glob(root + "**/*", File::FNM_DOTMATCH) paths = Dir.glob(root + "**/*", File::FNM_DOTMATCH)
paths = paths.reject { |p| p == root + '/.' || p == root + '/..' } paths = paths.reject { |p| p == "#{root}/." || p == "#{root}/.." }
dirs = paths.select { |path| File.directory?(path) } dirs = paths.select { |path| File.directory?(path) }
dirs = dirs.map { |p| p[root_length..-1] } dirs = dirs.map { |p| p[root_length..-1] }
paths = paths.map { |p| p[root_length..-1] } paths = paths.map { |p| p[root_length..-1] }
......
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