Skip to content

Commit 49f19fd

Browse files
GatsbyJS Botsidharthachatterjeeascorbic
authored
feat(gatsby): Respect VERBOSE env var (#29708) (#29713)
* feat(gatsby): Respect VERBOSE env var (#29708) * Respect GC_VERBOSE env var * Switch to VERBOSE * Support VERBOSE in build as well Co-authored-by: gatsbybot <mathews.kyle+gatsbybot@gmail.com> (cherry picked from commit 97d6d3e) * Add back chalk Co-authored-by: Sidhartha Chatterjee <me@sidharthachatterjee.com> Co-authored-by: Matt Kane <matt@gatsbyjs.com>
1 parent 6fa14e4 commit 49f19fd

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

packages/gatsby/src/commands/build.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ import {
3838
markWebpackStatusAsPending,
3939
markWebpackStatusAsDone,
4040
} from "../utils/webpack-status"
41-
import { updateSiteMetadata } from "gatsby-core-utils"
41+
import { updateSiteMetadata, isTruthy } from "gatsby-core-utils"
4242

4343
let cachedPageData
4444
let cachedWebpackCompilationHash
@@ -61,7 +61,7 @@ interface IBuildArgs extends IProgram {
6161
}
6262

6363
module.exports = async function build(program: IBuildArgs): Promise<void> {
64-
report.setVerbose(program.verbose)
64+
report.setVerbose(isTruthy(process.env.VERBOSE) || program.verbose)
6565

6666
if (program.profile) {
6767
report.warn(

packages/gatsby/src/commands/develop-process.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { syncStaticDir } from "../utils/get-static-dir"
22
import reporter from "gatsby-cli/lib/reporter"
33
import chalk from "chalk"
44
import telemetry from "gatsby-telemetry"
5+
import { isTruthy } from "gatsby-core-utils"
56
import express from "express"
67
import inspector from "inspector"
78
import { initTracer } from "../utils/tracer"
@@ -80,7 +81,7 @@ const openDebuggerPort = (debugInfo: IDebugInfo): void => {
8081
}
8182

8283
module.exports = async (program: IDevelopArgs): Promise<void> => {
83-
reporter.setVerbose(program.verbose)
84+
reporter.setVerbose(isTruthy(process.env.VERBOSE) || program.verbose)
8485

8586
if (program.debugInfo) {
8687
openDebuggerPort(program.debugInfo)

0 commit comments

Comments
 (0)