summaryrefslogtreecommitdiff
path: root/macosx/updateInfoPlist.rb
diff options
context:
space:
mode:
authorSND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2013-09-22 19:30:16 +0000
committerSND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2013-09-22 19:30:16 +0000
commiteebd15b67838eae81a6cbebd2f31c2437d3bb3c3 (patch)
tree39ff5dcd8e37a315b1f1afa33e15954dc3e20c68 /macosx/updateInfoPlist.rb
parentc4100b47d35af06f951e2e905051098a98ac4093 (diff)
downloadpcsxr-eebd15b67838eae81a6cbebd2f31c2437d3bb3c3.tar.gz
Making a more robust version control version tracking.
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@87260 e17a0e51-4ae3-4d35-97c3-1a29b211df97
Diffstat (limited to 'macosx/updateInfoPlist.rb')
-rw-r--r--macosx/updateInfoPlist.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/macosx/updateInfoPlist.rb b/macosx/updateInfoPlist.rb
new file mode 100644
index 00000000..e022801c
--- /dev/null
+++ b/macosx/updateInfoPlist.rb
@@ -0,0 +1,22 @@
+require 'osx/cocoa'
+include OSX
+OSX.require_framework 'ScriptingBridge'
+
+info = NSMutableDictionary.alloc.initWithContentsOfFile_(ARGV[0])
+
+if info != nil then
+ ## could read the plist file
+ currentVersion = %x[bash version.sh]
+
+ if currentVersion == "unknown" then
+ puts "version is invalid!"
+ else
+ puts "version is valid:" + currentVersion
+
+ currentVersion = currentVersion.chomp
+
+ info.setValue_forKey_(currentVersion, "CFBundleVersion")
+
+ info.writeToFile_atomically_(ARGV[0] + "vers.plist", 0)
+ end
+end \ No newline at end of file