Skip to content

Instantly share code, notes, and snippets.

@pietbrauer
Created May 6, 2015 14:34
Show Gist options
  • Save pietbrauer/82b287e30592ef1f194b to your computer and use it in GitHub Desktop.
Save pietbrauer/82b287e30592ef1f194b to your computer and use it in GitHub Desktop.
Script to change the Xcode location in a module map file
#!/usr/bin/ruby
Dir['CommonCrypto/*.modulemap'].each do |file_name|
text = File.read(file_name)
path = `xcode-select -p`.strip << "/"
new_contents = text.gsub(/\/Applications\/Xcode.app\/Contents\/Developer\//, path)
File.open(file_name, "w") {|file| file.puts new_contents }
end
module CommonCrypto [system] {
header "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/include/CommonCrypto/CommonCrypto.h"
export *
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment