1 | 'use strict'
|
2 |
|
3 | const Installer = require('libcipm')
|
4 | const lifecycleOpts = require('./config/lifecycle.js')
|
5 | const npm = require('./npm.js')
|
6 | const npmlog = require('npmlog')
|
7 | const pacoteOpts = require('./config/pacote.js')
|
8 |
|
9 | ci.usage = 'npm ci'
|
10 |
|
11 | ci.completion = (cb) => cb(null, [])
|
12 |
|
13 | Installer.CipmConfig.impl(npm.config, {
|
14 | get: npm.config.get,
|
15 | set: npm.config.set,
|
16 | toLifecycle (moreOpts) {
|
17 | return lifecycleOpts(moreOpts)
|
18 | },
|
19 | toPacote (moreOpts) {
|
20 | return pacoteOpts(moreOpts)
|
21 | }
|
22 | })
|
23 |
|
24 | module.exports = ci
|
25 | function ci (args, cb) {
|
26 | return new Installer({
|
27 | config: npm.config,
|
28 | log: npmlog
|
29 | })
|
30 | .run()
|
31 | .then(
|
32 | (details) => {
|
33 | npmlog.disableProgress()
|
34 | console.error(`added ${details.pkgCount} packages in ${
|
35 | details.runTime / 1000
|
36 | }s`)
|
37 | }
|
38 | )
|
39 | .then(() => cb(), cb)
|
40 | }
|
41 |
|
\ | No newline at end of file |