Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lib/commands/init.js')
-rw-r--r--lib/commands/init.js16
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/commands/init.js b/lib/commands/init.js
index eaca2716e..7e8a8f7a5 100644
--- a/lib/commands/init.js
+++ b/lib/commands/init.js
@@ -7,6 +7,7 @@ const rpj = require('read-package-json-fast')
const libexec = require('libnpmexec')
const mapWorkspaces = require('@npmcli/map-workspaces')
const PackageJson = require('@npmcli/package-json')
+const log = require('../utils/log-shim.js')
const getLocationMsg = require('../exec/get-workspace-location-msg.js')
const BaseCommand = require('../base-command.js')
@@ -94,7 +95,6 @@ class Init extends BaseCommand {
const {
flatOptions,
localBin,
- log,
globalBin,
} = this.npm
// this function is definitely called. But because of coverage map stuff
@@ -125,8 +125,8 @@ class Init extends BaseCommand {
}
async template (path = process.cwd()) {
- this.npm.log.pause()
- this.npm.log.disableProgress()
+ log.pause()
+ log.disableProgress()
const initFile = this.npm.config.get('init-module')
if (!this.npm.config.get('yes') && !this.npm.config.get('force')) {
@@ -147,17 +147,17 @@ class Init extends BaseCommand {
// XXX promisify init-package-json
await new Promise((res, rej) => {
initJson(path, initFile, this.npm.config, (er, data) => {
- this.npm.log.resume()
- this.npm.log.enableProgress()
- this.npm.log.silly('package data', data)
+ log.resume()
+ log.enableProgress()
+ log.silly('package data', data)
if (er && er.message === 'canceled') {
- this.npm.log.warn('init', 'canceled')
+ log.warn('init', 'canceled')
return res()
}
if (er) {
rej(er)
} else {
- this.npm.log.info('init', 'written successfully')
+ log.info('init', 'written successfully')
res(data)
}
})