From: Cheng Zhao Date: Thu, 7 Nov 2013 07:37:21 +0000 (+0800) Subject: Update Info.plist when bumping version. X-Git-Tag: v0.6.9~4 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=48a0ac9a964ed6722aef06ed9779ad83797fc4a5;p=electron.git Update Info.plist when bumping version. --- diff --git a/script/bump-version.py b/script/bump-version.py index 69ace904..5e7ab225 100644 --- a/script/bump-version.py +++ b/script/bump-version.py @@ -23,6 +23,7 @@ def main(): update_package_json(version) update_win_rc(version, versions) update_version_h(versions) + update_info_plist(version) def parse_version(version): @@ -89,5 +90,20 @@ def update_version_h(versions): return +def update_info_plist(version): + info_plist = os.path.join('browser', 'mac', 'Info.plist') + with open(info_plist, 'r') as f: + lines = f.readlines() + + for i in range(0, len(lines)): + line = lines[i] + if 'CFBundleVersion' in line: + lines[i + 1] = ' {0}\n'.format(version) + + with open(info_plist, 'w') as f: + f.write(''.join(lines)) + return + + if __name__ == '__main__': sys.exit(main())