1 | var Project = require('../core/Project');
|
2 | var defaultConfig = require('../config');
|
3 |
|
4 | function update(logger, names, options, config) {
|
5 | var project;
|
6 |
|
7 | options = options || {};
|
8 | config = defaultConfig(config);
|
9 | project = new Project(config, logger);
|
10 |
|
11 |
|
12 | if (names && !names.length) {
|
13 | names = null;
|
14 | }
|
15 |
|
16 | return project.update(names, options);
|
17 | }
|
18 |
|
19 |
|
20 |
|
21 | update.readOptions = function(argv) {
|
22 | var cli = require('../util/cli');
|
23 |
|
24 | var options = cli.readOptions(
|
25 | {
|
26 | 'force-latest': { type: Boolean, shorthand: 'F' },
|
27 | production: { type: Boolean, shorthand: 'p' }
|
28 | },
|
29 | argv
|
30 | );
|
31 |
|
32 | var names = options.argv.remain.slice(1);
|
33 |
|
34 | delete options.argv;
|
35 |
|
36 | return [names, options];
|
37 | };
|
38 |
|
39 | module.exports = update;
|