cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject [1/2] git commit: CB-6651 prepare release branch now updates version in package.json file
Date Thu, 19 Jun 2014 23:30:03 GMT
Repository: cordova-coho
Updated Branches:
  refs/heads/master eb9274f53 -> 079f75288


CB-6651 prepare release branch now updates version in package.json file


Project: http://git-wip-us.apache.org/repos/asf/cordova-coho/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-coho/commit/25aaf5ae
Tree: http://git-wip-us.apache.org/repos/asf/cordova-coho/tree/25aaf5ae
Diff: http://git-wip-us.apache.org/repos/asf/cordova-coho/diff/25aaf5ae

Branch: refs/heads/master
Commit: 25aaf5ae05edde7c9faa1ce6acdee21bac2462e6
Parents: eb9274f
Author: Steven Gill <stevengill97@gmail.com>
Authored: Thu Jun 19 16:28:27 2014 -0700
Committer: Steven Gill <stevengill97@gmail.com>
Committed: Thu Jun 19 16:28:27 2014 -0700

----------------------------------------------------------------------
 src/cadance-release.js | 16 ++++++++++++++++
 src/repoutil.js        | 15 +++++++--------
 2 files changed, 23 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-coho/blob/25aaf5ae/src/cadance-release.js
----------------------------------------------------------------------
diff --git a/src/cadance-release.js b/src/cadance-release.js
index dcdd245..3cd9b21 100644
--- a/src/cadance-release.js
+++ b/src/cadance-release.js
@@ -134,6 +134,22 @@ function *updateRepoVersion(repo, version) {
     } else {
         console.warn('No VERSION file exists in repo ' + repo.repoName);
     }
+    
+    // Update the package.json VERSION.
+    var packageFilePaths = repo.packageFilePaths || ['package.json'];
+    if (fs.existsSync(packageFilePaths[0])) {
+        fs.readFile(packageFilePaths[0], {encoding: 'utf-8'},function (err, data) {
+            if (err) throw err;
+            var packageJSON = JSON.parse(data);
+            packageJSON.version = version;
+            fs.writeFileSync(packageFilePaths[0], JSON.stringify(packageJSON, null, "   
"));
+        }); 
+        if (!(yield gitutil.pendingChangesExist())) {
+            print('package.json file was already up-to-date.');
+        }
+    } else {
+        console.warn('No package.json file exists in repo ' + repo.repoName);
+    }
 
     if (yield gitutil.pendingChangesExist()) {
         yield executil.execHelper(executil.ARGS('git commit -am', 'Set VERSION to ' + version
+ ' (via coho)'));

http://git-wip-us.apache.org/repos/asf/cordova-coho/blob/25aaf5ae/src/repoutil.js
----------------------------------------------------------------------
diff --git a/src/repoutil.js b/src/repoutil.js
index bb0a5b3..08fcdbd 100644
--- a/src/repoutil.js
+++ b/src/repoutil.js
@@ -48,12 +48,9 @@ var platformRepos = [
         repoName: 'cordova-blackberry',
         jiraComponentName: 'BlackBerry',
         cordovaJsSrcName: 'cordova.blackberry10.js',
-        cordovaJsPaths: [
-            path.join('blackberry10', 'javascript', 'cordova.blackberry10.js')
-            ],
-        versionFilePaths: [
-            path.join('blackberry10', 'VERSION'),
-            ]
+        cordovaJsPaths: [path.join('blackberry10', 'javascript', 'cordova.blackberry10.js')],
+        versionFilePaths: [path.join('blackberry10', 'VERSION')],
+        packageFilePaths: [path.join('blackberry10', 'package.json')]
     }, {
         title: 'Windows',
         id: 'windows',
@@ -61,14 +58,16 @@ var platformRepos = [
         jiraComponentName: 'Windows 8',
         cordovaJsSrcName: 'cordova.windows8.js',
         cordovaJsPaths: ['windows8/cordova.js', 'windows8/template/www/cordova.js'],
-        versionFilePaths: [path.join('windows8', 'VERSION'), path.join('windows8', 'template',
'VERSION')]
+        versionFilePaths: [path.join('windows8', 'VERSION'), path.join('windows8', 'template',
'VERSION')],
+        packageFilePaths: [path.join('windows8', 'package.json')]
     }, {
         title: 'Windows Phone 7 & 8',
         id: 'wp8',
         repoName: 'cordova-wp8',
         jiraComponentName: 'WP8',
         cordovaJsSrcName: 'cordova.windowsphone.js',
-        cordovaJsPaths: ['common/www/cordova.js']
+        cordovaJsPaths: ['common/www/cordova.js'],
+        packageFilePaths: [path.join('wp8', 'package.json')]
     }, {
         title: 'Firefox OS',
         id: 'firefoxos',


Mime
View raw message