-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathcli.js
executable file
·30 lines (27 loc) · 1.17 KB
/
cli.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/env node
'use strict';
var argv = require('optimist')
.usage('Usage: $0 --repo [[email protected]:your/dedicated/node_modules/git/repository.git] --verbose --cross-platform')
.describe('verbose', '[-v] Print progress log messages')
.describe('repo', 'git url to repository with node_modules content')
.describe('cross-platform', 'do not archive platform-specific files in node_modules')
.describe('incremental-install', 'start npm install with last node_modules instead of clearing them')
.describe('production', 'start npm install with production flag')
.describe('check-all-json-elements', 'Sha-1 calculated from all elements in package.json instead of only dependencies and devDependencies')
.alias('v', 'verbose')
.demand(['repo']).argv;
var checkoutNodeModules = require('./lib/checkout-node-modules');
checkoutNodeModules(process.cwd(), {
verbose: argv.verbose,
repo: argv.repo,
crossPlatform: argv['cross-platform'],
incrementalInstall: argv['incremental-install'],
production: argv['production'],
checkAllJsonElements: argv['check-all-json-elements']
})
.then(function () {
process.exit(0);
})
.catch(function (error) {
process.exit(1);
});