Commit 76892430 authored by Kyle Fuller's avatar Kyle Fuller

[pod repo push] Improve error when podspec is missing

Ref #3494
parent aa11287e
......@@ -190,10 +190,16 @@ module Pod
# @return [Array<Pathname>] The path of the specifications to push.
#
def podspec_files
files = Pathname.glob(@podspec || '*.podspec')
raise Informative, "Couldn't find any .podspec file in current directory" if files.empty?
if @podspec
path = Pathname(@podspec)
raise Informative, "Couldn't find #{@podspec}" unless path.exist?
[path]
else
files = Pathname.glob('*.podspec')
raise Informative, "Couldn't find any .podspec files in current directory" if files.empty?
files
end
end
# @return [Integer] The number of the podspec files to push.
#
......
......@@ -25,6 +25,12 @@ module Pod
e.message.should.match(/Couldn't find any .podspec/)
end
it "complains if it can't find the given podspec" do
repo_make('test_repo')
e = lambda { run_command('repo', 'push', 'test_repo', 'testspec.podspec') }.should.raise Pod::Informative
e.message.should.match(/Couldn't find testspec\.podspec/)
end
it "it raises if the specification doesn't validate" do
repo_make('test_repo')
Dir.chdir(temporary_directory) do
......
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