From 2d2ad0d33bdfc7d89fc2e68deb363fd846492328 Mon Sep 17 00:00:00 2001 From: "Sean Francis N. Ballais" Date: Thu, 10 Dec 2015 19:46:06 +0800 Subject: [PATCH] Addeda versionin package.json. --- package.json | 1 + script/bump-version.py | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/package.json b/package.json index ea29419925e0..af0e315ddab9 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,6 @@ { "name": "electron", + "version": "0.36.0", "devDependencies": { "asar": "^0.8.0", "coffee-script": "^1.9.2", diff --git a/script/bump-version.py b/script/bump-version.py index 3ee0b23df3b8..e2c22e8cd9d4 100755 --- a/script/bump-version.py +++ b/script/bump-version.py @@ -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)])