Skip to content

Instantly share code, notes, and snippets.

@vieko
Created February 19, 2014 04:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vieko/9085957 to your computer and use it in GitHub Desktop.
Save vieko/9085957 to your computer and use it in GitHub Desktop.
auto increment version number in Xamarin
#!/usr/bin/perl
my $version = `/usr/libexec/PlistBuddy -c "Print :CFBundleShortVersionString" "Info.plist"`;
if ($version =~ /(\d+)\.(\d+)\.(\d+)/) {
my $major = ($2 >= 99) ? int($1) + 1 : 0;
my $minor = ($3 >= 99) ? int($2) + 1 : 0;
my $rev = ($3 >= 99) ? 0 : int($3) + 1;
my $result = `/usr/libexec/PlistBuddy -c "Set :CFBundleShortVersionString $major.$minor.$rev" "Info.plist"`;
}
@vieko
Copy link
Author

vieko commented Feb 19, 2014

I need to revise this... doesn't work as intended :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment