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

[SourcesManager] Fix reporting of failure to add a repo by url

parent 539dc7d8
......@@ -36,14 +36,16 @@ module Pod
def find_or_create_source_with_url(url)
unless source = source_with_url(url)
name = name_for_url(url)
begin
Command::Repo::Add.new(CLAide::ARGV.new([name, url])).run
source = source_with_url(url)
rescue Informative => e
raise Informative, "Unable to add a source with url `#{url}` " \
"named `#{name}`.\nYou can add it manually via " \
"`pod repo add NAME #{url}`."
end
unless source
raise Informative, "Unable to add a source with url `#{url}` named " \
"`#{name}`.\nYou can add it manually via `pod repo add NAME " \
"#{url}`.\n\n#{output}"
source = source_with_url(url)
end
source
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