Skip to content

Commit

Permalink
feat: support json env in any case
Browse files Browse the repository at this point in the history
  • Loading branch information
mshanemc committed Apr 25, 2023
1 parent a02f269 commit a6d02bf
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/sfCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,9 +210,14 @@ export abstract class SfCommand<T> 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.
Expand Down

0 comments on commit a6d02bf

Please sign in to comment.