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

[PathList|Analyzer] Minor bugs.

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