Skip to content

Commit

Permalink
feat(gatsby): Respect VERBOSE env var (#29708) (#29713)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
3 people committed Feb 24, 2021
1 parent 6fa14e4 commit 49f19fd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions packages/gatsby/src/commands/build.ts
Expand Up @@ -38,7 +38,7 @@ import {
markWebpackStatusAsPending,
markWebpackStatusAsDone,
} from "../utils/webpack-status"
import { updateSiteMetadata } from "gatsby-core-utils"
import { updateSiteMetadata, isTruthy } from "gatsby-core-utils"

let cachedPageData
let cachedWebpackCompilationHash
Expand All @@ -61,7 +61,7 @@ interface IBuildArgs extends IProgram {
}

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

if (program.profile) {
report.warn(
Expand Down
3 changes: 2 additions & 1 deletion packages/gatsby/src/commands/develop-process.ts
Expand Up @@ -2,6 +2,7 @@ import { syncStaticDir } from "../utils/get-static-dir"
import reporter from "gatsby-cli/lib/reporter"
import chalk from "chalk"
import telemetry from "gatsby-telemetry"
import { isTruthy } from "gatsby-core-utils"
import express from "express"
import inspector from "inspector"
import { initTracer } from "../utils/tracer"
Expand Down Expand Up @@ -80,7 +81,7 @@ const openDebuggerPort = (debugInfo: IDebugInfo): void => {
}

module.exports = async (program: IDevelopArgs): Promise<void> => {
reporter.setVerbose(program.verbose)
reporter.setVerbose(isTruthy(process.env.VERBOSE) || program.verbose)

if (program.debugInfo) {
openDebuggerPort(program.debugInfo)
Expand Down

0 comments on commit 49f19fd

Please sign in to comment.