You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by an...@apache.org on 2015/09/02 13:31:12 UTC

cordova-cli git commit: CB-9597 Updates cli to pass structured args to platform methods

Repository: cordova-cli
Updated Branches:
  refs/heads/master d268c1bdc -> 027f727a0


CB-9597 Updates cli to pass structured args to platform methods


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

Branch: refs/heads/master
Commit: 027f727a048ba8cb95edeac60a3dad6d3c440312
Parents: d268c1b
Author: Vladimir Kotikov <v-...@microsoft.com>
Authored: Fri Jul 10 16:10:12 2015 +0300
Committer: Vladimir Kotikov <v-...@microsoft.com>
Committed: Wed Sep 2 14:27:54 2015 +0300

----------------------------------------------------------------------
 src/cli.js | 32 +++-----------------------------
 1 file changed, 3 insertions(+), 29 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/027f727a/src/cli.js
----------------------------------------------------------------------
diff --git a/src/cli.js b/src/cli.js
index 56379a5..9d9bfb5 100644
--- a/src/cli.js
+++ b/src/cli.js
@@ -185,7 +185,6 @@ function cli(inputArgs) {
         searchpath : args.searchpath
     };
 
-
     if (cmd == 'emulate' || cmd == 'build' || cmd == 'prepare' || cmd == 'compile' || cmd == 'run' || cmd === 'clean') {
         // All options without dashes are assumed to be platform names
         opts.platforms = undashed.slice(1);
@@ -210,34 +209,9 @@ function cli(inputArgs) {
             return platform;
         });
 
-        // Reconstruct the args to be passed along to platform scripts.
-        // This is an ugly temporary fix. The code spawning or otherwise
-        // calling into platform code should be dealing with this based
-        // on the parsed args object.
-        var downstreamArgs = [];
-        var argNames =
-            [ 'debug'
-            , 'release'
-            , 'device'
-            , 'emulator'
-            , 'nobuild'
-            , 'list'
-            ];
-        argNames.forEach(function(flag) {
-            if (args[flag]) {
-                downstreamArgs.push('--' + flag);
-            }
-        });
-        if (args.buildConfig) {
-            downstreamArgs.push('--buildConfig=' + args.buildConfig);
-        }
-        if (args.target) {
-            downstreamArgs.push('--target=' + args.target);
-        }
-        if (args.archs) {
-            downstreamArgs.push('--archs=' + args.archs);
-        }
-        opts.options = downstreamArgs.concat(unparsedArgs);
+        // Pass nopt-parsed args to PlatformApi through opts.options
+        opts.options = args;
+        opts.options.argv = unparsedArgs;
 
         if (cmd == 'run' && args.list && cordova.raw.targets) {
             cordova.raw.targets.call(null, opts).done();


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