cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject [01/32] cordova-lib git commit: CB-11960: Added support to package.json for platform/plugin add/rm
Date Wed, 22 Feb 2017 00:07:32 GMT
Repository: cordova-lib
Updated Branches:
  refs/heads/master a9605411a -> b0402b9e5


CB-11960: Added support to package.json for platform/plugin add/rm


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

Branch: refs/heads/master
Commit: f448f2f6530222ff39f5b1658f9fede50df0720b
Parents: a960541
Author: audreyso <auso@adobe.com>
Authored: Fri Oct 7 14:19:06 2016 -0700
Committer: Audrey So <audreyso@apache.org>
Committed: Mon Feb 13 16:10:11 2017 -0800

----------------------------------------------------------------------
 .../fixtures/basePkgJson/merges/.svn            |   0
 .../fixtures/basePkgJson/plugins/.svn           |   0
 .../fixtures/basePkgJson/www/img/logo.png       | Bin 0 -> 21814 bytes
 cordova-lib/spec-cordova/package.json.spec.js   | 389 +++++++++++++++++++
 cordova-lib/spec-cordova/pkgJson.spec.js        |   1 -
 cordova-lib/spec-cordova/platform.spec.js       |  34 +-
 cordova-lib/src/cordova/platform.js             |   5 +-
 7 files changed, 423 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/f448f2f6/cordova-lib/spec-cordova/fixtures/basePkgJson/merges/.svn
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-cordova/fixtures/basePkgJson/merges/.svn b/cordova-lib/spec-cordova/fixtures/basePkgJson/merges/.svn
new file mode 100644
index 0000000..e69de29

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/f448f2f6/cordova-lib/spec-cordova/fixtures/basePkgJson/plugins/.svn
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-cordova/fixtures/basePkgJson/plugins/.svn b/cordova-lib/spec-cordova/fixtures/basePkgJson/plugins/.svn
new file mode 100644
index 0000000..e69de29

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/f448f2f6/cordova-lib/spec-cordova/fixtures/basePkgJson/www/img/logo.png
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-cordova/fixtures/basePkgJson/www/img/logo.png b/cordova-lib/spec-cordova/fixtures/basePkgJson/www/img/logo.png
new file mode 100644
index 0000000..9519e7d
Binary files /dev/null and b/cordova-lib/spec-cordova/fixtures/basePkgJson/www/img/logo.png
differ

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/f448f2f6/cordova-lib/spec-cordova/package.json.spec.js
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-cordova/package.json.spec.js b/cordova-lib/spec-cordova/package.json.spec.js
new file mode 100644
index 0000000..1755834
--- /dev/null
+++ b/cordova-lib/spec-cordova/package.json.spec.js
@@ -0,0 +1,389 @@
+/**
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+*/
+var helpers = require('./helpers'),
+    path = require('path'),
+    fs = require('fs'),
+    shell = require('shelljs'),
+    superspawn = require('cordova-common').superspawn,
+    Q = require('q'),
+    events = require('cordova-common').events,
+    cordova = require('../src/cordova/cordova'),
+    rewire = require('rewire'),
+    prepare = require('../src/cordova/prepare'),
+    platforms = require('../src/platforms/platforms'),
+    platform = rewire('../src/cordova/platform.js');
+
+var projectRoot = 'C:\\Projects\\cordova-projects\\move-tracker';
+var pluginsDir = path.join(__dirname, 'fixtures', 'plugins');
+
+function addPlugin(target, id, options) {
+    // Checks that there are no plugins yet.
+    return cordova.raw.plugin('list').then(function() {
+        expect(results).toMatch(/No plugins added/gi);
+    }).then(function() {
+        // Adds a fake plugin from fixtures.
+        return cordova.raw.plugin('add', target, options);
+    }).then(function() {
+        expect(path.join(project, 'plugins', id, 'plugin.xml')).toExist();
+    }).then(function() {
+        return cordova.raw.plugin('ls');
+    }).then(function() {
+        expect(results).toContain(id);
+    });
+}
+// Runs: remove, list.
+function removePlugin(id, options) {
+    return cordova.raw.plugin('rm', id)
+    .then(function() {
+        // The whole dir should be gone.
+        expect(path.join(project, 'plugins', id)).not.toExist();
+    }).then(function() {
+        return cordova.raw.plugin('ls');
+    }).then(function() {
+        expect(results).toMatch(/No plugins added/gi);
+    });
+}
+// Checks if plugin list is empty.
+function emptyPluginList() {
+    return cordova.raw.plugin('list').then(function() {
+        var installed = results.match(/Installed plugins:\n  (.*)/);
+        expect(installed).toBeDefined();
+        expect(installed[1].indexOf('fake-plugin')).toBe(-1);
+    });
+}
+// Checks if plugin list exists.
+function fullPluginList() {
+    return cordova.raw.plugin('list').then(function() {
+        var installed = results.match(/Installed plugins:\n  (.*)/);
+        expect(installed).toBeDefined();
+        expect(installed[1].indexOf('fake-plugin')).toBeGreaterThan(-1);
+    });
+}
+
+// This group of tests checks if plugins are added and removed as expected.
+describe('plugin end-to-end', function() {
+    var pluginId = 'cordova-plugin-device';
+    var tmpDir = helpers.tmpDir('platform_test_pkgjson');
+    var project = path.join(tmpDir, 'project');
+    var results;
+
+    events.on('results', function(res) { results = res; });
+
+    beforeEach(function() {
+        shell.rm('-rf', project);
+
+        // Copy then move because we need to copy everything, but that means it will copy
the whole directory.
+        // Using /* doesn't work because of hidden files.
+        shell.cp('-R', path.join(__dirname, 'fixtures', 'basePkgJson'), tmpDir);
+        shell.mv(path.join(tmpDir, 'basePkgJson'), project);
+        // Copy some platform to avoid working on a project with no platforms.
+        shell.cp('-R', path.join(__dirname, 'fixtures', 'platforms', helpers.testPlatform),
path.join(project, 'platforms'));
+        process.chdir(project);
+
+        delete process.env.PWD;
+
+        spyOn(prepare, 'preparePlatforms').andCallThrough();
+    });
+
+    afterEach(function() {
+        process.chdir(path.join(__dirname, '..'));  // Needed to rm the dir on Windows.
+        shell.rm('-rf', tmpDir);
+    });
+
+    it('Test#001 : should successfully add and remove a plugin with no options', function(done)
{
+        var pkgJsonPath = path.join(process.cwd(),'package.json');
+        var pkgJson;
+        var retPromise;
+
+        expect(pkgJsonPath).toExist();
+
+        // Add the plugin with --save
+        return cordova.raw.plugin('add', pluginId, {'save':true})
+        .then(function() {
+            // Check that the plugin add was successful.
+            delete require.cache[require.resolve(pkgJsonPath)];
+            pkgJson = require(pkgJsonPath);
+            expect(pkgJson).not.toBeUndefined();
+            expect(pkgJson.cordova.plugins).not.toBeUndefined();
+            expect(pkgJson.cordova.plugins[pluginId]).toBeDefined();
+        }).then(function() {
+            // And now remove it with --save.
+            return cordova.raw.plugin('rm', pluginId, {'save':true})
+        }).then(function() {
+            // Delete any previous caches of require(package.json)
+            delete require.cache[require.resolve(pkgJsonPath)];
+            pkgJson = require(pkgJsonPath);
+            // Checking that the plugin removed is in not in the platforms
+            expect(pkgJson.cordova.plugins[pluginId]).toBeUndefined();
+        }).fail(function(err) {
+            expect(err).toBeUndefined();
+        }).fin(done);
+    });
+
+    it('Test#002 : should successfully NOT add a plugin if save is not there', function(done)
{
+        var pkgJsonPath = path.join(process.cwd(),'package.json');
+        var pkgJson;
+
+        expect(pkgJsonPath).toExist();
+
+        // Add the plugin with --save.
+        return cordova.raw.plugin('add', 'cordova-plugin-camera', {'save':true})
+        .then(function() {
+            // Add a second plugin without save
+            return cordova.raw.plugin('add', pluginId);
+        }).then(function() {
+            // Check the plugin add was successful for the first plugin that had --save.
+            delete require.cache[require.resolve(pkgJsonPath)];
+            pkgJson = require(pkgJsonPath);
+            expect(pkgJson).not.toBeUndefined();
+            expect(pkgJson.cordova.plugins['cordova-plugin-camera']).toBeDefined();
+            // Expect that the second plugin is not added.
+            expect(pkgJson.cordova.plugins[pluginId]).toBeUndefined();
+        }).fail(function(err) {
+            expect(err).toBeUndefined();
+        }).fin(done);
+    });
+
+    it('Test#003 : should NOT remove plugin if there is no --save', function(done) {
+        var pkgJsonPath = path.join(process.cwd(),'package.json');
+        var pkgJson;
+        var retPromise;
+
+        expect(pkgJsonPath).toExist();
+
+        // Add the plugin with --save.
+        return cordova.raw.plugin('add', pluginId, {'save':true})
+        .then(function() {
+            // Check the platform add was successful.
+            delete require.cache[require.resolve(pkgJsonPath)];
+            pkgJson = require(pkgJsonPath);
+            expect(pkgJson).not.toBeUndefined();
+            expect(pkgJson.cordova.plugins).toBeDefined();
+            expect(pkgJson.cordova.plugins[pluginId]).toBeDefined();
+        }).then(function() {
+            // And now remove it, but without --save.
+            return cordova.raw.plugin('rm', 'cordova-plugin-device')
+        }).then(function() {
+            // Delete any previous caches of require(package.json)
+            delete require.cache[require.resolve(pkgJsonPath)];
+            pkgJson = require(pkgJsonPath);
+            // The plugin should still be in package.json.
+            expect(pkgJson.cordova.plugins[pluginId]).toBeDefined();
+        }).fail(function(err) {
+            expect(err).toBeUndefined();
+        }).fin(done);
+    });
+
+    it('Test#004 : should successfully add and remove a plugin with variables and save',
function(done) {
+        var pkgJsonPath = path.join(process.cwd(),'package.json');
+        var pkgJson;
+        var retPromise;
+
+        expect(pkgJsonPath).toExist();
+
+        // Add the plugin with --save.
+        return cordova.raw.plugin('add', pluginId, {'save':true, 'cli_variables': {'someKey':'someValue'}})
+        .then(function() {
+            // Delete any previous caches of require(package.json)
+            delete require.cache[require.resolve(pkgJsonPath)];
+            pkgJson = require(pkgJsonPath);
+            // Check the plugin add was successful and that variables have been added too.
+            expect(pkgJson).not.toBeUndefined();
+            expect(pkgJson.cordova.plugins).toBeDefined();
+            expect(pkgJson.cordova.plugins[pluginId]).toBeDefined();
+            expect(pkgJson.cordova.plugins[pluginId]['someKey']).toEqual('someValue');
+        }).then(function() {
+            // And now remove it with --save.
+            return cordova.raw.plugin('rm', pluginId, {'save':true})
+        }).then(function() {
+            // Delete any previous caches of require(package.json)
+            delete require.cache[require.resolve(pkgJsonPath)];
+            pkgJson = require(pkgJsonPath);
+            // Checking that the plugin and variables were removed successfully.
+            expect(pkgJson.cordova.plugins[pluginId]).toBeUndefined();
+        }).fail(function(err) {
+            expect(err).toBeUndefined();
+        }).fin(done);
+    });
+});
+
+// This group of tests checks if platforms are added and removed as expected.
+describe('platform end-to-end with --save', function () {
+    var tmpDir = helpers.tmpDir('platform_test_pkgjson');
+    var project = path.join(tmpDir, 'project');
+    var results;
+
+    beforeEach(function() {
+        shell.rm('-rf', tmpDir);
+
+        // cp then mv because we need to copy everything, but that means it'll copy the whole
directory.
+        // Using /* doesn't work because of hidden files.
+        shell.cp('-R', path.join(__dirname, 'fixtures', 'basePkgJson'), tmpDir);
+        shell.mv(path.join(tmpDir, 'basePkgJson'), project);
+        process.chdir(project);
+
+        // The config.json in the fixture project points at fake "local" paths.
+        // Since it's not a URL, the lazy-loader will just return the junk path.
+        spyOn(superspawn, 'spawn').andCallFake(function(cmd, args) {
+            if (cmd.match(/create\b/)) {
+                // This is a call to the bin/create script, so do the copy ourselves.
+                shell.cp('-R', path.join(__dirname, 'fixtures', 'platforms', 'android'),
path.join(project, 'platforms'));
+            } else if(cmd.match(/version\b/)) {
+                return Q('3.3.0');
+            } else if(cmd.match(/update\b/)) {
+                fs.writeFileSync(path.join(project, 'platforms', helpers.testPlatform, 'updated'),
'I was updated!', 'utf-8');
+            }
+            return Q();
+        });
+        events.on('results', function(res) { results = res; });
+    });
+
+    afterEach(function() {
+        delete require.cache[require.resolve(path.join(process.cwd(),'package.json'))];
+        process.chdir(path.join(__dirname, '..'));  // Needed to rm the dir on Windows.
+        shell.rm('-rf', tmpDir);
+
+    });
+
+    // Factoring out some repeated checks.
+    function emptyPlatformList() {
+        return cordova.raw.platform('list').then(function() {
+            var installed = results.match(/Installed platforms:\n  (.*)/);
+            expect(installed).toBeDefined();
+            expect(installed[1].indexOf(helpers.testPlatform)).toBe(-1);
+        });
+    }
+    function fullPlatformList() {
+        return cordova.raw.platform('list').then(function() {
+            var installed = results.match(/Installed platforms:\n  (.*)/);
+            expect(installed).toBeDefined();
+            expect(installed[1].indexOf(helpers.testPlatform)).toBeGreaterThan(-1);
+        });
+    }
+
+    it('Test#006 : platform is added and removed correctly with --save', function(done) {
+        var pkgJsonPath = path.join(process.cwd(),'package.json');
+        expect(pkgJsonPath).toExist();
+        var pkgJson = require(pkgJsonPath);
+
+        // Check there are no platforms yet.
+        emptyPlatformList().then(function() {
+            // Add the testing platform with --save.
+            return cordova.raw.platform('add', [helpers.testPlatform], {'save':true});
+        }).then(function() {
+            // Check the platform add was successful.
+            expect(pkgJson.cordova.platforms).not.toBeUndefined();
+            expect(pkgJson.cordova.platforms.indexOf(helpers.testPlatform)).toBeGreaterThan(-1);
+
+        }).then(fullPlatformList) // Platform should still be in platform ls.
+        .then(function() {
+            // And now remove it with --save.
+            return cordova.raw.platform('rm', [helpers.testPlatform], {'save':true});
+        }).then(function() {
+            // Delete any previous caches of require(package.json)
+            delete require.cache[require.resolve(pkgJsonPath)];
+            pkgJson = require(pkgJsonPath);
+            // Checking that the platform removed is in not in the platforms key
+            expect(pkgJson.cordova.platforms.indexOf(helpers.testPlatform)).toEqual(-1);
+        }).then(emptyPlatformList) // platform ls should be empty too.
+        .fail(function(err) {
+            expect(err).toBeUndefined();
+        }).fin(done);
+    });
+
+    it('Test#007 : should not remove platforms from package.json when removing without --save',
function(done) {
+        var pkgJsonPath = path.join(process.cwd(),'package.json');
+        expect(pkgJsonPath).toExist();
+        var pkgJson = require(pkgJsonPath);
+        emptyPlatformList().then(function() {
+            // Add the testing platform with --save.
+            return cordova.raw.platform('add', [helpers.testPlatform], {'save':true});
+        }).then(function() {
+            // Check the platform add was successful.
+            expect(pkgJson.cordova.platforms).not.toBeUndefined();
+            expect(pkgJson.cordova.platforms.indexOf(helpers.testPlatform)).toBeGreaterThan(-1);
+        }).then(fullPlatformList) // Platform should still be in platform ls.
+        .then(function() {
+            // And now remove it without --save.
+            return cordova.raw.platform('rm', [helpers.testPlatform]);
+        }).then(function() {
+            // Delete any previous caches of require(package.json)
+            delete require.cache[require.resolve(pkgJsonPath)];
+            pkgJson = require(pkgJsonPath);
+
+            // Check that the platform removed without --save is still in platforms key.
+            expect(pkgJson.cordova.platforms.indexOf(helpers.testPlatform)).toBeGreaterThan(-1);
+        }).then(emptyPlatformList)
+        .fail(function(err) {
+            expect(err).toBeUndefined();
+        }).fin(done);
+    });
+
+    it('Test#008 : should not add platform to package.json when adding without --save', function(done)
{
+        var pkgJsonPath = path.join(process.cwd(),'package.json');
+        var pkgJson;
+        var platformToAdd = helpers.testPlatform;
+        expect(pkgJsonPath).toExist();
+
+        // Add platform without --save.
+        cordova.raw.platform('add',platformToAdd)
+        .then(function() {
+            // Check the platform add was successful, reload, skipping cache
+            delete require.cache[require.resolve(pkgJsonPath)];
+            pkgJson = require(pkgJsonPath);
+            // Beware empty/missing cordova object
+            var pckJsonCordova = pkgJson.cordova || {platforms:[]};
+            // Check that the platform has NOT been added.
+            expect(pckJsonCordova.platforms.indexOf(platformToAdd)).toEqual(-1);
+        })
+        .fail(function(err) {
+            expect(err).toBeUndefined();
+        })
+        .fin(done);
+    });
+
+    it('Test#009 : should only add the platform to package.json with --save', function(done)
{
+        var pkgJsonPath = path.join(process.cwd(),'package.json');
+        var pkgJson;
+        var platformToAdd = helpers.testPlatform;
+        var platformNotToAdd = 'ios';
+        expect(pkgJsonPath).toExist();
+
+        // Add a platform without --save.
+        cordova.raw.platform('add',platformNotToAdd)
+        .then(function() {
+            // And now add another platform with --save.
+            return cordova.raw.platform('add', platformToAdd, {'save':true});
+        }).then(function() {
+            // Check the platform add was successful, reload, skipping cache
+            delete require.cache[require.resolve(pkgJsonPath)];
+            pkgJson = require(pkgJsonPath);
+            // Beware empty/missing cordova object
+            var pckJsonCordova = pkgJson.cordova || {platforms:[]};
+            // Check that only the platform added with --save was added to package.json.
+            expect(pckJsonCordova.platforms.indexOf(platformToAdd)).toBeGreaterThan(-1);
+            expect(pckJsonCordova.platforms.indexOf(platformNotToAdd)).toEqual(-1);
+        })
+        .fail(function(err) {
+            expect(err).toBeUndefined();
+        })
+        .fin(done);
+    });
+});
+

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/f448f2f6/cordova-lib/spec-cordova/pkgJson.spec.js
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-cordova/pkgJson.spec.js b/cordova-lib/spec-cordova/pkgJson.spec.js
index c9d5440..8b3c46c 100644
--- a/cordova-lib/spec-cordova/pkgJson.spec.js
+++ b/cordova-lib/spec-cordova/pkgJson.spec.js
@@ -450,4 +450,3 @@ describe('platform end-to-end with --save', function () {
         }).fin(done);
     }, TIMEOUT);
 });
-

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/f448f2f6/cordova-lib/spec-cordova/platform.spec.js
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-cordova/platform.spec.js b/cordova-lib/spec-cordova/platform.spec.js
index 763ba9c..b7843ce 100644
--- a/cordova-lib/spec-cordova/platform.spec.js
+++ b/cordova-lib/spec-cordova/platform.spec.js
@@ -26,6 +26,8 @@ var helpers = require('./helpers'),
     cordova = require('../src/cordova/cordova'),
     plugman = require('../src/plugman/plugman'),
     rewire = require('rewire'),
+    prepare = require('../src/cordova/prepare'),
+    platforms = require('../src/platforms/platforms'),
     platform = rewire('../src/cordova/platform.js');
 
 var projectRoot = 'C:\\Projects\\cordova-projects\\move-tracker';
@@ -90,6 +92,34 @@ describe('platform end-to-end', function () {
             expect(installed[1].indexOf(helpers.testPlatform)).toBeGreaterThan(-1);
         });
     }
+    // Runs: list, add, list
+    function addPlugin(target, id, options) {
+        // Check there are no plugins yet.
+        return cordova.raw.plugin('list').then(function() {
+            expect(results).toMatch(/No plugins added/gi);
+        }).then(function() {
+            // Add a fake plugin from fixtures.
+            return cordova.raw.plugin('add', target, options);
+        }).then(function() {
+            expect(path.join(project, 'plugins', id, 'plugin.xml')).toExist();
+        }).then(function() {
+            return cordova.raw.plugin('ls');
+        }).then(function() {
+            expect(results).toContain(id);
+        });
+    }
+    // Runs: remove, list
+    function removePlugin(id) {
+        return cordova.raw.plugin('rm', id)
+        .then(function() {
+            // The whole dir should be gone.
+            expect(path.join(project, 'plugins', id)).not.toExist();
+        }).then(function() {
+            return cordova.raw.plugin('ls');
+        }).then(function() {
+            expect(results).toMatch(/No plugins added/gi);
+        });
+    }        
 
     // The flows we want to test are add, rm, list, and upgrade.
     // They should run the appropriate hooks.
@@ -102,6 +132,7 @@ describe('platform end-to-end', function () {
             // Add the testing platform.
             return cordova.raw.platform('add', [helpers.testPlatform]);
         }).then(function() {
+            console.log("!!!");
             // Check the platform add was successful.
             expect(path.join(project, 'platforms', helpers.testPlatform)).toExist();
             expect(path.join(project, 'platforms', helpers.testPlatform, 'cordova')).toExist();
@@ -117,7 +148,6 @@ describe('platform end-to-end', function () {
             // And now remove it.
             return cordova.raw.platform('rm', [helpers.testPlatform]);
         }).then(function() {
-            // It should be gone.
             expect(path.join(project, 'platforms', helpers.testPlatform)).not.toExist();
         }).then(emptyPlatformList) // platform ls should be empty too.
         .fail(function(err) {
@@ -353,4 +383,4 @@ describe('plugin add and rm end-to-end --fetch', function () {
         })
         .fin(done);
     }, 60000);
-});
\ No newline at end of file
+});

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/f448f2f6/cordova-lib/src/cordova/platform.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/cordova/platform.js b/cordova-lib/src/cordova/platform.js
index c529632..445493c 100644
--- a/cordova-lib/src/cordova/platform.js
+++ b/cordova-lib/src/cordova/platform.js
@@ -86,9 +86,7 @@ function addHelper(cmd, hooksRunner, projectRoot, targets, opts) {
         
         var platformsToSave = []; 
 
-        // If statement to see if pkgJsonPath exists in the filesystem
-        
-        return promiseutil.Q_chainmap(targets, function(target) {
+	return promiseutil.Q_chainmap(targets, function(target) {
             // For each platform, download it and call its helper script.
             var parts = target.split('@');
             var platform = parts[0];
@@ -222,6 +220,7 @@ function addHelper(cmd, hooksRunner, projectRoot, targets, opts) {
                 .then(function() {
                     var saveVersion = !spec || semver.validRange(spec, true);
 
+
                     // Save platform@spec into platforms.json, where 'spec' is a version
or a soure location. If a
                     // source location was specified, we always save that. Otherwise we save
the version that was
                     // actually installed.


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


Mime
View raw message