Skip to content

Instantly share code, notes, and snippets.

@volca
Forked from daveverwer/build.rb
Created December 12, 2011 07:59
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save volca/1465791 to your computer and use it in GitHub Desktop.
Save volca/1465791 to your computer and use it in GitHub Desktop.
Ruby script to replace an iOS settings bundle depending on the DEBUG/RELEASE build configuration flag.
configuration = ENV["CONFIGURATION"]
project_dir = ENV["PROJECT_DIR"]
settings_bundle = "#{project_dir}/Resources/Settings.bundle"
plist_location = "#{project_dir}/Resources/SettingPlists"
release_or_debug = ENV["CONFIGURATION"] == "Debug" ? "Debug" : "Release"
settings_plist = "#{plist_location}/SettingsRoot#{release_or_debug}.plist"
system("cp #{settings_plist} #{settings_bundle}/Root.plist");
system("touch #{settings_bundle}/Root.plist");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment