From d2e8a849d7ca93b3dba538a26ce5f9ab7f858984 Mon Sep 17 00:00:00 2001 From: Peter Hale Date: Thu, 10 Mar 2022 15:17:24 -0700 Subject: [PATCH] feat: suppress progress bar output with env vars @W-10825418@ --- src/sfCommand.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/sfCommand.ts b/src/sfCommand.ts index 59c0c904..1448528a 100644 --- a/src/sfCommand.ts +++ b/src/sfCommand.ts @@ -6,7 +6,15 @@ */ import * as os from 'os'; import { CliUx, Command, Config, HelpSection, Interfaces } from '@oclif/core'; -import { envVars, Messages, SfProject, StructuredMessage, Lifecycle, Mode } from '@salesforce/core'; +import { + envVars, + Messages, + SfProject, + StructuredMessage, + Lifecycle, + Mode, + EnvironmentVariable, +} from '@salesforce/core'; import { AnyJson } from '@salesforce/ts-types'; import chalk from 'chalk'; import { Progress, Prompter, Spinner, Ux } from './ux'; @@ -55,7 +63,7 @@ export abstract class SfCommand extends Command { super(argv, config); const outputEnabled = !this.jsonEnabled(); this.spinner = new Spinner(outputEnabled); - this.progress = new Progress(outputEnabled); + this.progress = new Progress(outputEnabled && envVars.getBoolean(EnvironmentVariable.SF_USE_PROGRESS_BAR, true)); this.ux = new Ux(outputEnabled); this.prompter = new Prompter(); this.lifecycle = Lifecycle.getInstance();