Sha256: 4b751a778ac5cd1c5e34509db951ae11c670d83593bffca25beddb1e96ab4023

Contents?: true

Size: 1.39 KB

Versions: 62

Compression:

Stored size: 1.39 KB

Contents

var endpointParser = require('bower-endpoint-parser');
var Project = require('../core/Project');
var Tracker = require('../util/analytics').Tracker;
var defaultConfig = require('../config');

function install(logger, endpoints, options, config) {
    var project;
    var decEndpoints;
    var tracker;

    options = options || {};
    config = defaultConfig(config);
    if (options.save === undefined) {
        options.save = config.defaultSave;
    }
    project = new Project(config, logger);
    tracker = new Tracker(config);

    // Convert endpoints to decomposed endpoints
    endpoints = endpoints || [];
    decEndpoints = endpoints.map(function (endpoint) {
        return endpointParser.decompose(endpoint);
    });
    tracker.trackDecomposedEndpoints('install', decEndpoints);

    return project.install(decEndpoints, options, config);
}

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

install.readOptions = function (argv) {
    var cli = require('../util/cli');

    var options = cli.readOptions({
        'force-latest': { type: Boolean, shorthand: 'F'},
        'production': { type: Boolean, shorthand: 'p' },
        'save': { type: Boolean, shorthand: 'S' },
        'save-dev': { type: Boolean, shorthand: 'D' },
        'save-exact': { type: Boolean, shorthand: 'E' }
    }, argv);

    var packages = options.argv.remain.slice(1);

    delete options.argv;

    return [packages, options];
};

module.exports = install;

Version data entries

62 entries across 62 versions & 1 rubygems

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