From bc0eca57e51c2dcc23b2b605c28d73e960fd122c Mon Sep 17 00:00:00 2001 From: GatsbyJS Bot Date: Tue, 9 Mar 2021 12:14:18 -0500 Subject: [PATCH] fix(gatsby): set program.verbose when VERBOSE env var is used (#30123) (#30136) (cherry picked from commit 632f9151ceb2d5621dc720adca3ee8049e6179d6) Co-authored-by: Michal Piechowiak --- packages/gatsby/src/commands/build.ts | 5 ++++- packages/gatsby/src/commands/develop-process.ts | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/gatsby/src/commands/build.ts b/packages/gatsby/src/commands/build.ts index 8bdc30b3e87b6..30ab3b6f370de 100644 --- a/packages/gatsby/src/commands/build.ts +++ b/packages/gatsby/src/commands/build.ts @@ -46,7 +46,10 @@ import { import { updateSiteMetadata, isTruthy } from "gatsby-core-utils" module.exports = async function build(program: IBuildArgs): Promise { - report.setVerbose(isTruthy(process.env.VERBOSE) || program.verbose) + if (isTruthy(process.env.VERBOSE)) { + program.verbose = true + } + report.setVerbose(program.verbose) if (program.profile) { report.warn( diff --git a/packages/gatsby/src/commands/develop-process.ts b/packages/gatsby/src/commands/develop-process.ts index 42f138d8a2376..ea523cfb84251 100644 --- a/packages/gatsby/src/commands/develop-process.ts +++ b/packages/gatsby/src/commands/develop-process.ts @@ -80,7 +80,10 @@ const openDebuggerPort = (debugInfo: IDebugInfo): void => { } module.exports = async (program: IDevelopArgs): Promise => { - reporter.setVerbose(isTruthy(process.env.VERBOSE) || program.verbose) + if (isTruthy(process.env.VERBOSE)) { + program.verbose = true + } + reporter.setVerbose(program.verbose) if (program.debugInfo) { openDebuggerPort(program.debugInfo)