forked from bestander/npm-git-lock
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcli.js
executable file
·28 lines (25 loc) · 996 Bytes
/
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
#!/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')
.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']
})
.then(function () {
process.exit(0);
})
.catch(function (error) {
process.exit(1);
});