diff --git a/lib/cocoapods-binary/Main.rb b/lib/cocoapods-binary/Main.rb index 2510d3a..4dbcb33 100644 --- a/lib/cocoapods-binary/Main.rb +++ b/lib/cocoapods-binary/Main.rb @@ -64,6 +64,18 @@ def keep_source_code_for_prebuilt_frameworks! Pod::UI.puts "🚀 Prebuild frameworks" + # Fetch original installer (which is running this pre-install hook) options, + # then pass them to our installer to perform update if needed + # Looks like this is the most appropriate way to figure out that something should be updated + + update = nil + repo_update = nil + + include ObjectSpace + ObjectSpace.each_object(Pod::Installer) { |installer| + update = installer.update + repo_update = installer.repo_update + } # control features Pod.is_prebuild_stage = true @@ -82,11 +94,11 @@ def keep_source_code_for_prebuilt_frameworks! # install binary_installer = Pod::Installer.new(prebuild_sandbox, prebuild_podfile , nil) - if binary_installer.have_exact_prebuild_cache? + if binary_installer.have_exact_prebuild_cache? && !update binary_installer.install_when_cache_hit! else - binary_installer.repo_update = false - binary_installer.update = false + binary_installer.update = update + binary_installer.repo_update = repo_update binary_installer.install! end