@oclif/core 2.11.0 → 2.11.2

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.d.ts CHANGED
@@ -124,6 +124,7 @@ export declare abstract class Command {
124
124
  protected toSuccessJson(result: unknown): any;
125
125
  protected toErrorJson(err: unknown): any;
126
126
  protected logJson(json: unknown): void;
127
+ private removeEnvVar;
127
128
  }
128
129
  export declare namespace Command {
129
130
  type Class = typeof Command & {
package/lib/command.js CHANGED
@@ -112,7 +112,7 @@ class Command {
112
112
  let result;
113
113
  try {
114
114
  // remove redirected env var to allow subsessions to run autoupdated client
115
- this.config.scopedEnvVarKeys('REDIRECTED').map(key => delete process.env[key]);
115
+ this.removeEnvVar('REDIRECTED');
116
116
  await this.init();
117
117
  result = await this.run();
118
118
  }
@@ -256,6 +256,16 @@ class Command {
256
256
  logJson(json) {
257
257
  cli_ux_1.ux.styledJSON(json);
258
258
  }
259
+ removeEnvVar(envVar) {
260
+ const keys = [];
261
+ try {
262
+ keys.push(...this.config.scopedEnvVarKeys(envVar));
263
+ }
264
+ catch {
265
+ keys.push(this.config.scopedEnvVarKey(envVar));
266
+ }
267
+ keys.map(key => delete process.env[key]);
268
+ }
259
269
  }
260
270
  exports.Command = Command;
261
271
  Command._base = `${pjson.name}@${pjson.version}`;
@@ -79,7 +79,7 @@ const readStdin = async () => {
79
79
  debug('stdin.isTTY', stdin.isTTY);
80
80
  const nodeMajorVersion = Number(version.split('.')[0].replace(/^v/, ''));
81
81
  debug('node version', nodeMajorVersion);
82
- return nodeMajorVersion >= 14 ? readStdinLegacy() : readStdinWithTimeout();
82
+ return nodeMajorVersion >= 14 ? readStdinWithTimeout() : readStdinLegacy();
83
83
  };
84
84
  function isNegativeNumber(input) {
85
85
  return /^-\d/g.test(input);
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.0",
4
+ "version": "2.11.2",
5
5
  "author": "Salesforce",
6
6
  "bugs": "https://github.com/oclif/core/issues",
7
7
  "dependencies": {