cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vladimir-kotikov <...@git.apache.org>
Subject [GitHub] cordova-lib pull request #498: CB-11985 Check if cached platform/plugin exis...
Date Mon, 10 Oct 2016 08:47:23 GMT
Github user vladimir-kotikov commented on a diff in the pull request:

    https://github.com/apache/cordova-lib/pull/498#discussion_r82563870
  
    --- Diff: cordova-lib/src/plugman/registry/registry.js ---
    @@ -114,19 +113,11 @@ function initThenLoadSettingsWithRestore(promises) {
     }
     
     /**
    -* @param {Array} with one element - the plugin id or "id@version"
    +* @param {string} plugin - the plugin id or "id@version"
     * @return {Promise.<string>} Promised path to fetched package.
     */
     function fetchPlugin(plugin) {
    -    return initThenLoadSettingsWithRestore(function () {
    -        events.emit('log', 'Fetching plugin "' + plugin + '" via npm');
    -        return Q.ninvoke(npm.commands, 'cache', ['add', plugin])
    -        .then(function (info) {
    -            var unpack = require('../../util/unpack');
    -            var pluginDir = path.resolve(npm.cache, info.name, info.version, 'package');
    -            // Unpack the plugin that was added to the cache (CB-8154)
    -            var package_tgz = path.resolve(npm.cache, info.name, info.version, 'package.tgz');
    -            return unpack.unpackTgz(package_tgz, pluginDir);
    -        });
    -    });
    +    events.emit('log', 'Fetching plugin "' + plugin + '" via npm');
    +    var pluginSplit = plugin.split('@');
    +    return npmhelper.fetchPackage(pluginSplit[0], pluginSplit[1]);
    --- End diff --
    
    Looks like this will not work for scoped NPM packages (like `@scope/cordova-plugin-camera@2.0.0`).
`pluginSplit[0]` and `pluginSplit[1]` would become `''` and `'scope/cordova-plugin-camera'`
in this case.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


Mime
View raw message