Last active
December 26, 2015 22:57
-
-
Save anton-matosov/2bcd42ded9092f2ba25b to your computer and use it in GitHub Desktop.
Podfile post_install hack which removes the beta suffix from version in info.plist to fix AppStore validation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Podfile post_install hack which removes the beta suffix from version in info.plist to fix AppStore validation | |
# Credit to jerolimov comment https://github.com/ReactiveX/RxSwift/issues/206#issuecomment-158074615 | |
post_install do |installer| | |
plist_buddy = "/usr/libexec/PlistBuddy" | |
installer.pods_project.targets.each do |target| | |
plist = "Pods/Target Support Files/#{target}/Info.plist" | |
original_version = `#{plist_buddy} -c "Print CFBundleShortVersionString" "#{plist}"`.strip | |
changed_version = original_version[/(\d+\.){1,2}(\d+)?/] | |
unless original_version == changed_version | |
puts "Fix version of Pod \"#{target}\": #{original_version} => #{changed_version}" | |
`#{plist_buddy} -c "Set CFBundleShortVersionString #{changed_version}" "#{plist}"` | |
end | |
end | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment