From c1b97d6b564a740e5367b4eec1959835c7019721 Mon Sep 17 00:00:00 2001 From: Greg Magolan Date: Mon, 30 Dec 2019 16:21:03 -0800 Subject: [PATCH] fix(create): @bazel/create should verbose log based on VERBOSE_LOGS instead of COMPILATION_MODE --- packages/create/index.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/packages/create/index.js b/packages/create/index.js index 2950c6dd3f..a1d07520c2 100644 --- a/packages/create/index.js +++ b/packages/create/index.js @@ -2,7 +2,11 @@ const fs = require('fs'); const path = require('path'); -const DEBUG = process.env['COMPILATION_MODE'] === 'dbg'; +const VERBOSE_LOGS = !!process.env['VERBOSE_LOGS']; + +function log_verbose(...m) { + if (VERBOSE_LOGS) console.error('[@bazel/create]', ...m); +} /** * Detect if the user ran `yarn create @bazel` so we can default @@ -73,10 +77,8 @@ function main(argv, error = console.error, log = console.log) { // Which package manager will be used in the new project const pkgMgr = args['packageManager'] || detectRunningUnderYarn() ? 'yarn' : 'npm'; - if (DEBUG) { - log('Running with', process.argv); - log('Environment', process.env); - } + log_verbose('Running with', process.argv); + log_verbose('Environment', process.env); const [wkspDir] = args['_']; // TODO: user might want these to differ