I'm just now updating to CocoaPods 0.38.2 (or trying to) and have run into an issue with my pre_install hook that removes unwanted localizations. I've read through the CocoaPods update documentation but after converting my pods to pods_targets I'm still getting an error:
undefined method 'root' for <Pod::PodTarget name=Alamofire >:Pod::PodTarget
I don't see a replacement for root in the new PodTarget definition.
Here's the original hook:
pre_install do |installer|
supported_locales = ['base', 'en']
installer.pod_targets.each do |pod|
# remove unused localizations
%x[ find "#{pod.root}" -name '*.lproj' ].split.each do |bundle|
if (!supported_locales.include?(File.basename(bundle, ".lproj").downcase))
# puts "Removing #{bundle}"
FileUtils.rm_rf(bundle)
end
end
end
end
Ideas?
You can use this solution, by modifying the supported_locales array to match your supported locales :
pre_install do |installer|
supported_locales = ['base', 'da', 'en']
Dir.glob(File.join(installer.sandbox.pod_dir('FormatterKit'), '**', '*.lproj')).each do |bundle|
if (!supported_locales.include?(File.basename(bundle, ".lproj").downcase))
puts "Removing #{bundle}"
FileUtils.rm_rf(bundle)
end
end
end
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With