cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fil...@apache.org
Subject cordova-coho git commit: plugins releaser: accept environment variables for JIRA credentials
Date Thu, 27 Apr 2017 16:15:21 GMT
Repository: cordova-coho
Updated Branches:
  refs/heads/master 173a24537 -> 92743227c


plugins releaser: accept environment variables for JIRA credentials


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

Branch: refs/heads/master
Commit: 92743227cd09e264a8b0e3728e263ae821f3349b
Parents: 173a245
Author: filmaj <maj.fil@gmail.com>
Authored: Thu Apr 27 09:14:49 2017 -0700
Committer: filmaj <maj.fil@gmail.com>
Committed: Thu Apr 27 09:14:49 2017 -0700

----------------------------------------------------------------------
 src/plugin-release.js | 31 +++++++++++++++++++++----------
 1 file changed, 21 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-coho/blob/92743227/src/plugin-release.js
----------------------------------------------------------------------
diff --git a/src/plugin-release.js b/src/plugin-release.js
index 4d31331..233008e 100644
--- a/src/plugin-release.js
+++ b/src/plugin-release.js
@@ -18,6 +18,7 @@ under the License.
 */
 
 var co = require('co');
+var Q = require('q');
 var path = require('path');
 var fs = require('fs');
 var util = require('util');
@@ -124,16 +125,26 @@ function *interactive_plugins_release() {
         console.error('I did not find `svn` on your PATH!');
         process.exit(1);
     }
-    console.log('Let\'s start with your JIRA credentials - this system will be interacting
with Apache\'s JIRA instance (issues.apache.org) often.');
-    inquirer.prompt([{
-        type: 'input',
-        name: 'username',
-        message: 'Please enter your JIRA username'
-    },{
-        type: 'password',
-        name: 'password',
-        message: 'Please enter your JIRA password'
-    }]).then(function(answers) {
+    return Q.fcall(function() {
+        if (process.env.JIRA_USER && process.env.JIRA_PASSWORD) {
+            return {
+                username: process.env.JIRA_USER,
+                password: process.env.JIRA_PASSWORD
+            }
+        } else {
+            console.log('Let\'s start with your JIRA credentials - this system will be interacting
with Apache\'s JIRA instance (issues.apache.org) often.');
+            console.log('(Note that you can export environment variables `JIRA_USER` and
`JIRA_PASSWORD` so I won\'t ask you next time.)');
+            return inquirer.prompt([{
+                type: 'input',
+                name: 'username',
+                message: 'Please enter your JIRA username'
+            },{
+                type: 'password',
+                name: 'password',
+                message: 'Please enter your JIRA password'
+            }])
+        }
+    }).then(function(answers) {
         var username = answers.username;
         you = username;
         var password = answers.password;


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


Mime
View raw message