@oclif/core 2.11.0 → 2.11.1
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 +1 -0
- package/lib/command.js +11 -1
- package/package.json +1 -1
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.
|
|
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}`;
|