Repository: cordova-cli Updated Branches: refs/heads/master 92cce9735 -> 72ff10f0d
CB-13353 : added save-exact to cli and unit test This closes #286 Project: http://git-wip-us.apache.org/repos/asf/cordova-cli/repo Commit: http://git-wip-us.apache.org/repos/asf/cordova-cli/commit/72ff10f0 Tree: http://git-wip-us.apache.org/repos/asf/cordova-cli/tree/72ff10f0 Diff: http://git-wip-us.apache.org/repos/asf/cordova-cli/diff/72ff10f0 Branch: refs/heads/master Commit: 72ff10f0d35a79f2e9394453098c43c96ea06a58 Parents: 92cce97 Author: Audrey So <[email protected]> Authored: Fri Sep 29 15:40:55 2017 -0700 Committer: Steve Gill <[email protected]> Committed: Tue Oct 3 19:00:47 2017 -0700 ---------------------------------------------------------------------- spec/cli.spec.js | 13 +++++++++++++ src/cli.js | 7 +++++++ 2 files changed, 20 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/72ff10f0/spec/cli.spec.js ---------------------------------------------------------------------- diff --git a/spec/cli.spec.js b/spec/cli.spec.js index 4031821..7c93921 100644 --- a/spec/cli.spec.js +++ b/spec/cli.spec.js @@ -265,6 +265,19 @@ describe('cordova cli', function () { }); }); + it('(add) will pass save-exact:true', function (done) { + cli(['node', 'cordova', 'plugin', 'add', 'device', '--save-exact'], function () { + expect(cordova.plugin).toHaveBeenCalledWith( + 'add', + ['device'], + jasmine.any(Object) + ); + var opts = cordova.plugin.calls.argsFor(0)[2]; + expect(opts.save_exact).toBe(true); + done(); + }); + }); + it('Test #021 : (remove) fetch is true by default and will pass fetch:true', function (done) { cli(['node', 'cordova', 'plugin', 'remove', 'device'], function () { expect(cordova.plugin).toHaveBeenCalledWith( http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/72ff10f0/src/cli.js ---------------------------------------------------------------------- diff --git a/src/cli.js b/src/cli.js index 463a442..955c828 100644 --- a/src/cli.js +++ b/src/cli.js @@ -47,6 +47,7 @@ var knownOpts = { 'variable': Array, 'link': Boolean, 'force': Boolean, + 'save-exact': Boolean, // Flags to be passed to `cordova build/run/emulate` 'debug': Boolean, 'release': Boolean, @@ -466,6 +467,11 @@ function cli (inputArgs) { args.searchpath = conf.get('searchpath'); } + if (args['save-exact'] === undefined) { + // User explicitly did not pass in save-exact + args['save-exact'] = conf.get('save-exact'); + } + var download_opts = { searchpath: args.searchpath, noregistry: args.noregistry, nohooks: args.nohooks, @@ -474,6 +480,7 @@ function cli (inputArgs) { fetch: args.fetch, link: args.link || false, save: args.save, + save_exact: args['save-exact'] || false, shrinkwrap: args.shrinkwrap || false, force: args.force || false }; --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
