Created
January 24, 2011 08:26
-
-
Save tylerhall/792971 to your computer and use it in GitHub Desktop.
Inserts your most recent git commit hash into your app's Info.plist
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
<?PHP | |
$fn = "{$_ENV['BUILT_PRODUCTS_DIR']}/{$_ENV['WRAPPER_NAME']}/Contents/Info.plist"; | |
$rev = trim(`git rev-parse HEAD`); | |
$plist = file_get_contents($fn); | |
$plist = preg_replace('/CFBundleVersion<\/key>.*?<string>(.*?)<\/string>/ms', "CFBundleVersion</key>\n\t<string>$rev</string>", $plist); | |
file_put_contents($fn, $plist); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment