diff --git a/src/sfCommand.ts b/src/sfCommand.ts index 4b4285cbe..5763be28e 100644 --- a/src/sfCommand.ts +++ b/src/sfCommand.ts @@ -210,9 +210,14 @@ export abstract class SfCommand extends Command { } public jsonEnabled(): boolean { - // can come from either oclif's detection of the flag's presence and truthiness OR from the env // https://developer.salesforce.com/docs/atlas.en-us.sfdx_setup.meta/sfdx_setup/sfdx_dev_cli_json_support.htm - return super.jsonEnabled() || envVars.getString(EnvironmentVariable.SF_CONTENT_TYPE) === 'JSON'; + // can come from either oclif's detection of the flag's presence and truthiness OR from the env + // unless it's been explicitly disabled on the command's statics + return ( + super.jsonEnabled() || + (SfCommand.enableJsonFlag !== false && + envVars.getString(EnvironmentVariable.SF_CONTENT_TYPE)?.toUpperCase() === 'JSON') + ); } /** * Log a success message that has the standard success message color applied.