Skip to content

Commit

Permalink
Rescue dependency error.
Browse files Browse the repository at this point in the history
  • Loading branch information
James Campbell committed Mar 10, 2016
1 parent bd3b22d commit ff8bbdf
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
17 changes: 13 additions & 4 deletions lib/cocoapods-deploy/deploy_transformer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,23 71,32 @@ def collect_podspec_dependencies(name_or_hash)
dependency = parse_dependency(name_or_hash)
specification = @sandbox.specification(dependency.root_name)

specification.dependencies.map do |dep|
transform_dependency(dep.name)
dependencies = pecification.dependencies.map do |dep|
begin
transform_dependency(dep.name)
rescue Informative
nil
end
end if specification

dependencies.select { |dep|
dep != nil
}
end

def transform_dependency(name_or_hash)
dependency = parse_dependency(name_or_hash)
pod = dependency.name
checkout_options = @lockfile.checkout_options_for_pod_named(pod)

unless @lockfile.checkout_options_for_pod_named(dependency.name)
unless checkout_options
root_pod = dependency.root_name
version = @lockfile.version(pod)
raise Informative, "Missing dependency \"#{pod}\" in Lockfile please run `pod install` or `pod update`." unless version

({ "#{pod}" => [{ :podspec => podspec_url(root_pod, version) }] })
else
({ "#{pod}" => [@lockfile.checkout_options_for_pod_named(dependency.name)] })
({ "#{pod}" => [checkout_options] })
end
end
end
Expand Down
2 changes: 2 additions & 0 deletions spec/command/deploy_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 140,8 @@ module Pod
end

# Figure out how to test external source here.

# Figure out how to handle location
end
end
end

0 comments on commit ff8bbdf

Please sign in to comment.