cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject [01/14] cordova-coho git commit: CB-11909 changed prepare-release-branch command to grab version from package.json
Date Mon, 10 Apr 2017 23:14:18 GMT
Repository: cordova-coho
Updated Branches:
  refs/heads/master 89a945460 -> 68026cde1


CB-11909 changed prepare-release-branch command to grab version from package.json


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

Branch: refs/heads/master
Commit: 18ed32635478932f5700b6f0ea0850b27dfd1d6b
Parents: 3feac17
Author: audreyso <auso@adobe.com>
Authored: Tue Sep 27 14:51:39 2016 -0700
Committer: audreyso <auso@adobe.com>
Committed: Tue Sep 27 16:33:24 2016 -0700

----------------------------------------------------------------------
 src/platform-release.js | 27 +++++++++++++++++++++------
 1 file changed, 21 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-coho/blob/18ed3263/src/platform-release.js
----------------------------------------------------------------------
diff --git a/src/platform-release.js b/src/platform-release.js
index a9ebce1..10700e7 100644
--- a/src/platform-release.js
+++ b/src/platform-release.js
@@ -61,8 +61,7 @@ function configureReleaseCommandFlags(opt) {
     var opt = flagutil.registerRepoFlag(opt)
     opt = opt
         .options('version', {
-            desc: 'The version to use for the branch. Must match the pattern #.#.#[-rc#]',
-            demand: true
+            desc: 'The version to use for the branch. Must match the pattern #.#.#[-rc#]'
          });
     opt = flagutil.registerHelpFlag(opt);
     argv = opt.argv;
@@ -71,7 +70,7 @@ function configureReleaseCommandFlags(opt) {
         optimist.showHelp();
         process.exit(1);
     }
-    var version = flagutil.validateVersionString(argv.version);
+
     return argv;
 }
 
@@ -128,14 +127,29 @@ exports.prepareReleaseBranchCommand = function*() {
                '\n' +
                'Usage: $0 prepare-release-branch --version=3.6.0 -r platform')
     );
+   
     var repos = flagutil.computeReposFromFlag(argv.r);
-    var version = flagutil.validateVersionString(argv.version);
-    var branchName = getVersionBranchName(version);
+    var branchName = null;
+ 
 
     // First - perform precondition checks.
     yield repoupdate.updateRepos(repos, [], true);
 
     yield repoutil.forEachRepo(repos, function*(repo) {
+       
+        var version = null;
+
+        if (argv.version === undefined) {
+            // Grabbing version from platformPackageJson
+            var platformPackage = path.join(process.cwd(), 'package.json');
+            var platformPackageJson = require(platformPackage);
+            var version = flagutil.validateVersionString(platformPackageJson.version); 
+        } else {
+            var version = flagutil.validateVersionString(argv.version);
+        }
+
+        branchName = getVersionBranchName(version);
+
         yield gitutil.stashAndPop(repo, function*() {
             // git fetch + update master
             yield repoupdate.updateRepos([repo], ['master'], false);
@@ -152,7 +166,8 @@ exports.prepareReleaseBranchCommand = function*() {
                 yield gitutil.gitCheckout('master');
                 yield executil.execHelper(executil.ARGS('git checkout -b ' + branchName));
             }
-            yield updateJsSnapshot(repo, version);
+    
+            yield updateJsSnapshot(repo, version); 
             print(repo.repoName + ': ' + 'Setting VERSION to "' + version + '" on branch
+ "' + branchName + '".');
             yield versionutil.updateRepoVersion(repo, version);
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


Mime
View raw message