@oclif/core 2.11.6 → 2.11.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/command.js CHANGED
@@ -165,7 +165,7 @@ class Command {
165
165
  const jsonIndex = this.argv.indexOf('--json');
166
166
  return jsonIndex > -1 && (ptIndex === -1 || jsonIndex < ptIndex);
167
167
  }
168
- return this.argv.includes('--json');
168
+ return this.argv.includes('--json') || this.config.scopedEnvVar?.('CONTENT_TYPE')?.toLowerCase() === 'json';
169
169
  }
170
170
  async init() {
171
171
  this.debug('init version: %s argv: %o', this.ctor._base, this.argv);
@@ -356,7 +356,7 @@ class Config {
356
356
  * @returns {string[]} e.g. ['SF_DEBUG', 'SFDX_DEBUG']
357
357
  */
358
358
  scopedEnvVarKeys(k) {
359
- return [this.bin, ...this.binAliases ?? []].map(alias => [alias.replace(/@/g, '').replace(/[/-]/g, '_'), k].join('_').toUpperCase());
359
+ return [this.bin, ...this.binAliases ?? []].filter(alias => Boolean(alias)).map(alias => [alias.replace(/@/g, '').replace(/[/-]/g, '_'), k].join('_').toUpperCase());
360
360
  }
361
361
  findCommand(id, opts = {}) {
362
362
  const lookupId = this.getCmdLookupId(id);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@oclif/core",
3
3
  "description": "base library for oclif CLIs",
4
- "version": "2.11.6",
4
+ "version": "2.11.8",
5
5
  "author": "Salesforce",
6
6
  "bugs": "https://github.com/oclif/core/issues",
7
7
  "dependencies": {