Created
October 20, 2011 22:39
-
-
Save jfro/1302608 to your computer and use it in GitHub Desktop.
Re-sign frameworks in a bundle
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
#!/usr/bin/ruby | |
require 'find' | |
require 'fileutils' | |
require 'getoptlong' | |
if ARGV.length < 2 | |
puts "Usage: ruby re-sign-frameworks.rb bundle signer" | |
exit | |
end | |
problem = false | |
productPath = ARGV.shift | |
identity = ARGV.shift | |
Find.find(productPath) do |path| | |
if not File.exists? path | |
puts "No such file #{path}" | |
problem = true | |
break | |
end | |
if path[-10..-1] == '.framework' | |
versions = Dir.glob(path+"/Versions/*") | |
for version in versions | |
if File.basename(version) != 'Current' | |
puts 'Re-signing: ' + version | |
%x{codesign -f -s "#{identity}" #{version}} | |
end | |
end | |
end | |
end | |
if problem | |
exit(1) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment