Sha256: 892196b49a726763e38f9454a98c73c05781e55d0bcdc5296ac1c6a724afb1ee

Contents?: true

Size: 1.09 KB

Versions: 62

Compression:

Stored size: 1.09 KB

Contents

var mout = require('mout');
var PackageRepository = require('../../core/PackageRepository');
var defaultConfig = require('../../config');

function list(logger, packages, options, config) {
    var repository;

    config = defaultConfig(config);
    repository = new PackageRepository(config, logger);

    // If packages is an empty array, null them
    if (packages && !packages.length) {
        packages = null;
    }

    return repository.list()
    .then(function (entries) {
        if (packages) {
            // Filter entries according to the specified packages
            entries = entries.filter(function (entry) {
                return !!mout.array.find(packages, function (pkg) {
                    return pkg === entry.pkgMeta.name;
                });
            });
        }

        return entries;
    });
}

// -------------------

list.readOptions = function (argv) {
    var cli = require('../../util/cli');
    var options = cli.readOptions(argv);
    var packages = options.argv.remain.slice(2);

    delete options.argv;

    return [packages, options];
};

module.exports = list;

Version data entries

62 entries across 62 versions & 1 rubygems

Version Path
trusty-festivity-extension-2.6.3 node_modules/bower/lib/commands/cache/list.js
trusty-festivity-extension-2.6.2 node_modules/bower/lib/commands/cache/list.js
trusty-festivity-extension-2.6.1 node_modules/bower/lib/commands/cache/list.js
trusty-festivity-extension-2.6 node_modules/bower/lib/commands/cache/list.js
trusty-festivity-extension-2.5.19 node_modules/bower/lib/commands/cache/list.js
trusty-festivity-extension-2.5.18 node_modules/bower/lib/commands/cache/list.js
trusty-festivity-extension-2.5.17 node_modules/bower/lib/commands/cache/list.js
trusty-festivity-extension-2.5.16 node_modules/bower/lib/commands/cache/list.js
trusty-festivity-extension-2.5.15 node_modules/bower/lib/commands/cache/list.js
trusty-festivity-extension-2.5.14 node_modules/bower/lib/commands/cache/list.js
trusty-festivity-extension-2.5.13 node_modules/bower/lib/commands/cache/list.js
trusty-festivity-extension-2.5.12 node_modules/bower/lib/commands/cache/list.js
trusty-festivity-extension-2.5.11 node_modules/bower/lib/commands/cache/list.js
trusty-festivity-extension-2.5.10 node_modules/bower/lib/commands/cache/list.js
trusty-festivity-extension-2.5.9 node_modules/bower/lib/commands/cache/list.js
trusty-festivity-extension-2.5.8 node_modules/bower/lib/commands/cache/list.js
trusty-festivity-extension-2.5.7 node_modules/bower/lib/commands/cache/list.js
trusty-festivity-extension-2.5.6 node_modules/bower/lib/commands/cache/list.js
trusty-festivity-extension-2.5.5 node_modules/bower/lib/commands/cache/list.js
trusty-festivity-extension-2.5.4 node_modules/bower/lib/commands/cache/list.js