Skip to content

Commit

Permalink
[ExternalSources] Robustness.
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiopelosin committed Aug 20, 2012
1 parent dca782c commit 6624bfc
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/cocoapods/dependency.rb
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ def copy_external_source_into_sandbox(sandbox, _)
output_path = sandbox.root + "Local Podspecs/#{name}.podspec"
output_path.dirname.mkpath
puts "-> Fetching podspec for `#{name}' from: #{@params[:podspec]}" unless config.silent?
open(@params[:podspec]) do |io|
open(Pathname.new(@params[:podspec]).expand_path) do |io|
output_path.open('w') { |f| f << io.read }
end
end
Expand All @@ -216,9 +216,9 @@ def description

class LocalSource < AbstractExternalSource
def pod_spec_path
root = Pathname.new(@params[:local])
path = spec_path = Dir[root + "*.podspec"].first
Pathname.new(path)
path = Pathname.new(@params[:local]).expand_path + "#{name}.podspec"
raise Informative, "No podspec found for `#{name}` in #{description}" unless path.exist?
path
end

def copy_external_source_into_sandbox(sandbox, _)
Expand Down

0 comments on commit 6624bfc

Please sign in to comment.