Skip to content

Commit 1d1b193

Browse files
committed
Added additional explanation comments, moved from instance variables to local ones
1 parent e9e0417 commit 1d1b193

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

lib/cocoapods-binary/Main.rb

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,17 @@ def keep_source_code_for_prebuilt_frameworks!
6464

6565
Pod::UI.puts "🚀 Prebuild frameworks"
6666

67+
# Fetch original installer (which is running this pre-install hook) options,
68+
# then pass them to our installer to perform update if needed
6769
# Looks like this is the most appropriate way to figure out that something should be updated
70+
71+
update = nil
72+
repo_update = nil
73+
6874
include ObjectSpace
6975
ObjectSpace.each_object(Pod::Installer) { |installer|
70-
@update = installer.update
71-
@repo_update = installer.repo_update
76+
update = installer.update
77+
repo_update = installer.repo_update
7278
}
7379

7480
# control features
@@ -88,11 +94,11 @@ def keep_source_code_for_prebuilt_frameworks!
8894
# install
8995
binary_installer = Pod::Installer.new(prebuild_sandbox, prebuild_podfile , nil)
9096

91-
if binary_installer.have_exact_prebuild_cache? && !@update
97+
if binary_installer.have_exact_prebuild_cache? && !update
9298
binary_installer.install_when_cache_hit!
9399
else
94-
binary_installer.update = @update
95-
binary_installer.repo_update = @repo_update
100+
binary_installer.update = update
101+
binary_installer.repo_update = repo_update
96102
binary_installer.install!
97103
end
98104

0 commit comments

Comments
 (0)