You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ra...@apache.org on 2018/09/11 20:50:42 UTC

[cordova-cli] branch master updated: Remove support for fetch option (#322)

This is an automated email from the ASF dual-hosted git repository.

raphinesse pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cordova-cli.git


The following commit(s) were added to refs/heads/master by this push:
     new 20af4ec  Remove support for fetch option (#322)
20af4ec is described below

commit 20af4ecfd32a52d3151e95a496b18cd50022e147
Author: Raphael von der GrĂ¼n <ra...@gmail.com>
AuthorDate: Tue Sep 11 22:50:40 2018 +0200

    Remove support for fetch option (#322)
---
 spec/cli.spec.js | 60 ++++++--------------------------------------------------
 src/cli.js       |  3 ---
 2 files changed, 6 insertions(+), 57 deletions(-)

diff --git a/spec/cli.spec.js b/spec/cli.spec.js
index 26afc93..fcf9a6c 100644
--- a/spec/cli.spec.js
+++ b/spec/cli.spec.js
@@ -79,37 +79,37 @@ describe('cordova cli', () => {
 
         it('Test#005 : will call command with all arguments passed through', () => {
             return cli(['node', 'cordova', 'build', 'blackberry10', '--', '-k', 'abcd1234']).then(() => {
-                expect(cordova.build).toHaveBeenCalledWith({ platforms: ['blackberry10'], options: { argv: ['-k', 'abcd1234'] }, verbose: false, silent: false, fetch: true, nohooks: [ ], searchpath: undefined });
+                expect(cordova.build).toHaveBeenCalledWith({ platforms: ['blackberry10'], options: { argv: ['-k', 'abcd1234'] }, verbose: false, silent: false, nohooks: [ ], searchpath: undefined });
             });
         }, 60000);
 
         it('Test#006 : will consume the first instance of -d', () => {
             return cli(['node', 'cordova', '-d', 'build', 'blackberry10', '--', '-k', 'abcd1234', '-d']).then(() => {
-                expect(cordova.build).toHaveBeenCalledWith({ platforms: ['blackberry10'], options: { verbose: true, argv: ['-k', 'abcd1234', '-d'] }, verbose: true, silent: false, fetch: true, nohooks: [ ], searchpath: undefined });
+                expect(cordova.build).toHaveBeenCalledWith({ platforms: ['blackberry10'], options: { verbose: true, argv: ['-k', 'abcd1234', '-d'] }, verbose: true, silent: false, nohooks: [ ], searchpath: undefined });
             });
         });
 
         it('Test#007 : will consume the first instance of --verbose', () => {
             return cli(['node', 'cordova', '--verbose', 'build', 'blackberry10', '--', '-k', 'abcd1234', '--verbose']).then(() => {
-                expect(cordova.build).toHaveBeenCalledWith({ platforms: ['blackberry10'], options: { verbose: true, argv: ['-k', 'abcd1234', '--verbose'] }, verbose: true, silent: false, fetch: true, nohooks: [ ], searchpath: undefined });
+                expect(cordova.build).toHaveBeenCalledWith({ platforms: ['blackberry10'], options: { verbose: true, argv: ['-k', 'abcd1234', '--verbose'] }, verbose: true, silent: false, nohooks: [ ], searchpath: undefined });
             });
         });
 
         it('Test#008 : will consume the first instance of either --verbose or -d', () => {
             return cli(['node', 'cordova', '--verbose', 'build', 'blackberry10', '--', '-k', 'abcd1234', '-d']).then(() => {
-                expect(cordova.build).toHaveBeenCalledWith({ platforms: ['blackberry10'], options: { verbose: true, argv: ['-k', 'abcd1234', '-d'] }, verbose: true, silent: false, fetch: true, nohooks: [ ], searchpath: undefined });
+                expect(cordova.build).toHaveBeenCalledWith({ platforms: ['blackberry10'], options: { verbose: true, argv: ['-k', 'abcd1234', '-d'] }, verbose: true, silent: false, nohooks: [ ], searchpath: undefined });
             });
         });
 
         it('Test#009 : will consume the first instance of either --verbose or -d', () => {
             return cli(['node', 'cordova', '-d', 'build', 'blackberry10', '--', '-k', 'abcd1234', '--verbose']).then(() => {
-                expect(cordova.build).toHaveBeenCalledWith({ platforms: ['blackberry10'], options: { verbose: true, argv: ['-k', 'abcd1234', '--verbose'] }, verbose: true, silent: false, fetch: true, nohooks: [ ], searchpath: undefined });
+                expect(cordova.build).toHaveBeenCalledWith({ platforms: ['blackberry10'], options: { verbose: true, argv: ['-k', 'abcd1234', '--verbose'] }, verbose: true, silent: false, nohooks: [ ], searchpath: undefined });
             });
         });
 
         it('Test#010 : will consume the first instance of --silent', () => {
             return cli(['node', 'cordova', '--silent', 'build', 'blackberry10', '--', '-k', 'abcd1234', '--silent']).then(() => {
-                expect(cordova.build).toHaveBeenCalledWith({ platforms: ['blackberry10'], options: { silent: true, argv: ['-k', 'abcd1234', '--silent'] }, verbose: false, silent: true, fetch: true, nohooks: [ ], searchpath: undefined });
+                expect(cordova.build).toHaveBeenCalledWith({ platforms: ['blackberry10'], options: { silent: true, argv: ['-k', 'abcd1234', '--silent'] }, verbose: false, silent: true, nohooks: [ ], searchpath: undefined });
             });
         });
     });
@@ -215,18 +215,6 @@ describe('cordova cli', () => {
             });
         });
 
-        it('Test #020 : (add) fetch is true by default and will pass fetch:true', () => {
-            return cli(['node', 'cordova', 'plugin', 'add', 'device']).then(() => {
-                expect(cordova.plugin).toHaveBeenCalledWith(
-                    'add',
-                    ['device'],
-                    jasmine.any(Object)
-                );
-                const opts = cordova.plugin.calls.argsFor(0)[2];
-                expect(opts.fetch).toBe(true);
-            });
-        });
-
         it('(add) will pass save-exact:true', () => {
             return cli(['node', 'cordova', 'plugin', 'add', 'device', '--save-exact']).then(() => {
                 expect(cordova.plugin).toHaveBeenCalledWith(
@@ -239,18 +227,6 @@ describe('cordova cli', () => {
             });
         });
 
-        it('Test #021 : (remove) fetch is true by default and will pass fetch:true', () => {
-            return cli(['node', 'cordova', 'plugin', 'remove', 'device']).then(() => {
-                expect(cordova.plugin).toHaveBeenCalledWith(
-                    'remove',
-                    ['device'],
-                    jasmine.any(Object)
-                );
-                const opts = cordova.plugin.calls.argsFor(0)[2];
-                expect(opts.fetch).toBe(true);
-            });
-        });
-
         it('(add) will pass noprod:true and production:false', () => {
             return cli(['node', 'cordova', 'plugin', 'add', 'device', '--noprod']).then(() => {
                 expect(cordova.plugin).toHaveBeenCalledWith(
@@ -440,30 +416,6 @@ describe('platform', () => {
             expect(opts.save).toBe(false);
         });
     });
-
-    it('Test #039 : (add) fetch is true by default and will pass fetch:true', () => {
-        return cli(['node', 'cordova', 'platform', 'add', 'device']).then(() => {
-            expect(cordova.platform).toHaveBeenCalledWith(
-                'add',
-                ['device'],
-                jasmine.any(Object)
-            );
-            const opts = cordova.platform.calls.argsFor(0)[2];
-            expect(opts.fetch).toBe(true);
-        });
-    });
-
-    it('Test #040 : (remove) fetch is true by default and will pass fetch:true', () => {
-        return cli(['node', 'cordova', 'platform', 'remove', 'device']).then(() => {
-            expect(cordova.platform).toHaveBeenCalledWith(
-                'remove',
-                ['device'],
-                jasmine.any(Object)
-            );
-            const opts = cordova.platform.calls.argsFor(0)[2];
-            expect(opts.fetch).toBe(true);
-        });
-    });
 });
 
 describe('config', () => {
diff --git a/src/cli.js b/src/cli.js
index 59499f6..77cdbbd 100644
--- a/src/cli.js
+++ b/src/cli.js
@@ -55,7 +55,6 @@ var knownOpts = {
     'emulator': Boolean,
     'target': String,
     'noprepare': Boolean,
-    'fetch': Boolean,
     'nobuild': Boolean,
     'list': Boolean,
     'buildConfig': String,
@@ -348,7 +347,6 @@ function cli (inputArgs) {
         options: [],
         verbose: args.verbose || false,
         silent: args.silent || false,
-        fetch: true,
         nohooks: args.nohooks || [],
         searchpath: args.searchpath
     };
@@ -464,7 +462,6 @@ function cli (inputArgs) {
             noregistry: args.noregistry,
             nohooks: args.nohooks,
             cli_variables: cli_vars,
-            fetch: true,
             link: args.link || false,
             save: args.save,
             save_exact: args['save-exact'] || false,


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