Addeda versionin package.json.

This commit is contained in:
Sean Francis N. Ballais 2015-12-10 19:46:06 +08:00 committed by Cheng Zhao
parent 2fa7088fd1
commit 2d2ad0d33b
2 changed files with 17 additions and 0 deletions

View file

@ -1,5 +1,6 @@
{
"name": "electron",
"version": "0.36.0",
"devDependencies": {
"asar": "^0.8.0",
"coffee-script": "^1.9.2",

View file

@ -31,6 +31,7 @@ def main():
update_win_rc(version, versions)
update_version_h(versions)
update_info_plist(version)
update_package_json(version)
tag_version(version)
@ -113,6 +114,21 @@ def update_info_plist(version):
f.write(''.join(lines))
def update_package_json(version):
package_json = 'package.json'
with open(package_json, 'r') as f:
lines = f.readlines()
for i in range(0, len(lines)):
line = lines[i];
if 'version' in line:
lines[i] = ' "version": "{0}",\n'.format(version)
break
with open(package_json, 'w') as f:
f.write(''.join(lines))
def tag_version(version):
execute(['git', 'commit', '-a', '-m', 'Bump v{0}'.format(version)])