Repository: cordova-cli
Updated Branches:
  refs/heads/master 72ff10f0d -> b876e6b20


CB-13303 : added noprod/production as an option, no prod turns off production

 This closes #287


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

Branch: refs/heads/master
Commit: b876e6b20bc1648347921dd27c909a6c7de05cc8
Parents: 72ff10f
Author: Audrey So <[email protected]>
Authored: Tue Oct 3 14:14:18 2017 -0700
Committer: Steve Gill <[email protected]>
Committed: Tue Oct 3 19:01:13 2017 -0700

----------------------------------------------------------------------
 spec/cli.spec.js | 13 +++++++++++++
 src/cli.js       | 17 +++++++++++++++--
 2 files changed, 28 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/b876e6b2/spec/cli.spec.js
----------------------------------------------------------------------
diff --git a/spec/cli.spec.js b/spec/cli.spec.js
index 7c93921..2f17f2a 100644
--- a/spec/cli.spec.js
+++ b/spec/cli.spec.js
@@ -303,6 +303,19 @@ describe('cordova cli', function () {
                 done();
             });
         });
+
+        it('(add) will pass noprod:true and production:false', function (done) 
{
+            cli(['node', 'cordova', 'plugin', 'add', 'device', '--noprod'], 
function () {
+                expect(cordova.plugin).toHaveBeenCalledWith(
+                    'add',
+                    ['device'],
+                    jasmine.any(Object)
+                );
+                var opts = cordova.plugin.calls.argsFor(0)[2];
+                expect(opts.production).toBe(false);
+                done();
+            });
+        });
     });
 
     describe('telemetry', function () {

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/b876e6b2/src/cli.js
----------------------------------------------------------------------
diff --git a/src/cli.js b/src/cli.js
index 955c828..c029578 100644
--- a/src/cli.js
+++ b/src/cli.js
@@ -61,7 +61,9 @@ var knownOpts = {
     'nobuild': Boolean,
     'list': Boolean,
     'buildConfig': String,
-    'template': String
+    'template': String,
+    'production': Boolean,
+    'noprod': Boolean
 };
 
 var shortHands = {
@@ -450,6 +452,12 @@ function cli (inputArgs) {
             args.save = true;
         }
 
+        if (args.noprod) {
+            args.production = false;
+        } else {
+            args.production = true;
+        }
+
         if (args.save === undefined) {
             // User explicitly did not pass in save
             args.save = conf.get('autosave');
@@ -466,6 +474,10 @@ function cli (inputArgs) {
             // User explicitly did not pass in searchpath
             args.searchpath = conf.get('searchpath');
         }
+        if (args.production === undefined) {
+            // User explicitly did not pass in noprod
+            args.production = conf.get('production');
+        }
 
         if (args['save-exact'] === undefined) {
             // User explicitly did not pass in save-exact
@@ -482,7 +494,8 @@ function cli (inputArgs) {
             save: args.save,
             save_exact: args['save-exact'] || false,
             shrinkwrap: args.shrinkwrap || false,
-            force: args.force || false
+            force: args.force || false,
+            production: args.production
         };
         return cordova[cmd](subcommand, targets, download_opts);
     }


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to