From 74dc62e10d00fe5efc9fbf218d7d9d41279c56b8 Mon Sep 17 00:00:00 2001 From: zhaoweibing Date: Mon, 11 Jan 2021 19:43:46 +0800 Subject: [PATCH] fix: Issue #79 --- .gitignore | 2 ++ .../lib/cocoapods-imy-bin/command/bin/auto.rb | 11 ++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index e69de29..af56f61 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1,2 @@ +.DS_Store +.idea/ diff --git a/cocoapods-imy-bin/lib/cocoapods-imy-bin/command/bin/auto.rb b/cocoapods-imy-bin/lib/cocoapods-imy-bin/command/bin/auto.rb index 281f834..eec13d2 100755 --- a/cocoapods-imy-bin/lib/cocoapods-imy-bin/command/bin/auto.rb +++ b/cocoapods-imy-bin/lib/cocoapods-imy-bin/command/bin/auto.rb @@ -46,11 +46,14 @@ def initialize(argv) 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 = [] @@ -175,6 +178,7 @@ def spec_file #Dir.glob 可替代 def find_podspec + name = nil Pathname.pwd.children.each do |child| puts child if File.file?(child) @@ -185,6 +189,7 @@ def find_podspec end end end + return name end end