You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ka...@apache.org on 2014/05/30 23:38:57 UTC
git commit: Add --usenpm flag to activate npm based lazy_load
Repository: cordova-cli
Updated Branches:
refs/heads/master 7b75074ee -> 57179d61d
Add --usenpm flag to activate npm based lazy_load
See the corresponding change in colrdova-lib
https://git-wip-us.apache.org/repos/asf?p=cordova-lib.git;a=commit;h=55810360fe
Project: http://git-wip-us.apache.org/repos/asf/cordova-cli/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-cli/commit/57179d61
Tree: http://git-wip-us.apache.org/repos/asf/cordova-cli/tree/57179d61
Diff: http://git-wip-us.apache.org/repos/asf/cordova-cli/diff/57179d61
Branch: refs/heads/master
Commit: 57179d61d0c35e32c808198d184d0d515fbb0c28
Parents: 7b75074
Author: Mark Koudritsky <ka...@gmail.com>
Authored: Fri May 30 17:34:31 2014 -0400
Committer: Mark Koudritsky <ka...@gmail.com>
Committed: Fri May 30 17:34:31 2014 -0400
----------------------------------------------------------------------
src/cli.js | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/57179d61/src/cli.js
----------------------------------------------------------------------
diff --git a/src/cli.js b/src/cli.js
index 0e71d5d..c088802 100644
--- a/src/cli.js
+++ b/src/cli.js
@@ -54,6 +54,7 @@ module.exports = function CLI(inputArgs) {
.boolean('experimental')
.boolean('noregistry')
.boolean('shrinkwrap')
+ .boolean('usenpm')
.string('copy-from')
.alias('copy-from', 'src')
.string('link-to')
@@ -118,6 +119,10 @@ module.exports = function CLI(inputArgs) {
tokens.splice(tokens.indexOf("--noregistry"), 1);
}
+ if (args.usenpm) {
+ tokens.splice(tokens.indexOf("--usenpm"), 1);
+ }
+
var cmd = tokens && tokens.length ? tokens.splice(0,1) : undefined;
if (cmd === undefined) {
return help();
@@ -166,20 +171,25 @@ module.exports = function CLI(inputArgs) {
cordova.raw[cmd].call(this, args._[1], args._[2], args._[3], cfg).done();
} else if( cmd == 'save' || cmd == 'restore'){
if(!opts.experimental && !args.experimental ){
- throw new CordovaError('save and restore commands are experimental, please add "--experimental" to indicate that you understand that it may change in the future');
+ throw new CordovaError('save and restore commands are experimental, please add "--experimental" to indicate that you understand that it may change in the future');
}
var subcommand = tokens[0]
if(subcommand == 'plugins'){
cordova.raw[cmd].call(this,'plugins',{ shrinkwrap:args.shrinkwrap });
}else{
throw new CordovaError('Let cordova know what you want to '+ cmd + ', try "cordova '+ cmd +' plugins"');
- }
+ }
} else if (cmd == 'help') {
return help();
} else {
// platform/plugins add/rm [target(s)]
var subcommand = tokens[0]; // this has the sub-command, like "add", "ls", "rm" etc.
var targets = tokens.slice(1); // this should be an array of targets, be it platforms or plugins
- cordova.raw[cmd].call(this, subcommand, targets, { searchpath: args.searchpath, noregistry: args.noregistry }).done();
+ var download_opts = {
+ searchpath: args.searchpath,
+ noregistry: args.noregistry,
+ usenpm: args.usenpm
+ }
+ cordova.raw[cmd].call(this, subcommand, targets, download_opts).done();
}
};