lib/cocoapods-imy-bin/command/bin/auto.rb in cocoapods-imy-bin-0.3.0.11 vs lib/cocoapods-imy-bin/command/bin/auto.rb in cocoapods-imy-bin-0.3.1.2
- old
+ new
@@ -44,15 +44,18 @@
@additional_args = argv.remainder!
super
end
+ def validate!
+ help! "未找到 podspec文件" unless @podspec
+ super
+ end
+
def run
+ @specification = Specification.from_file(@podspec)
- unless @podspec
- raise Informative, "未找到 podspec文件"
- end
sources_sepc = run_archive
fail_push_specs = []
sources_sepc.uniq.each do |spec|
begin
@@ -118,11 +121,11 @@
end
if @env
argvs += ["--env=#{@env}"]
end
argvs += ["--configuration=#{@config}"]
-
+
archive = Pod::Command::Bin::Archive.new(CLAide::ARGV.new(argvs))
archive.validate!
sources_sepc = archive.run
sources_sepc
end
@@ -173,20 +176,22 @@
end
end
#Dir.glob 可替代
def find_podspec
+ name = nil
Pathname.pwd.children.each do |child|
puts child
if File.file?(child)
if child.extname == '.podspec'
- name = File.basename(child)
- unless name.include?("binary-template")
- return name
- end
+ name = File.basename(child)
+ unless name.include?("binary-template")
+ return name
+ end
end
end
end
+ return name
end
end
end
end