@oclif/core 4.8.2 → 4.8.4
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/config/config.js +9 -19
- package/package.json +1 -1
package/lib/config/config.js
CHANGED
|
@@ -156,23 +156,11 @@ class Config {
|
|
|
156
156
|
if (typeof opts === 'string')
|
|
157
157
|
opts = { root: opts };
|
|
158
158
|
if (isConfig(opts)) {
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
*
|
|
165
|
-
* Doing this ensures that the command can freely use any method on Config that
|
|
166
|
-
* exists in the version of Config required by the command but may not exist on the
|
|
167
|
-
* root's instance of Config.
|
|
168
|
-
*/
|
|
169
|
-
if (BASE !== opts._base) {
|
|
170
|
-
debug(`reloading config from ${opts._base} to ${BASE}`);
|
|
171
|
-
const config = new Config({ ...opts.options, plugins: opts.plugins });
|
|
172
|
-
await config.load();
|
|
173
|
-
return config;
|
|
174
|
-
}
|
|
175
|
-
return opts;
|
|
159
|
+
debug(`reloading config from ${opts._base} to ${BASE}`);
|
|
160
|
+
const pluginMap = new Map(opts.getPluginsList().map((p) => [p.name, p]));
|
|
161
|
+
const config = new Config({ ...opts.options, plugins: pluginMap });
|
|
162
|
+
await config.load();
|
|
163
|
+
return config;
|
|
176
164
|
}
|
|
177
165
|
const config = new Config(opts);
|
|
178
166
|
await config.load();
|
|
@@ -215,10 +203,12 @@ class Config {
|
|
|
215
203
|
if (SHELL) {
|
|
216
204
|
shellPath = SHELL.split('/');
|
|
217
205
|
}
|
|
218
|
-
else if (this.windows &&
|
|
206
|
+
else if (this.windows &&
|
|
207
|
+
(process.title.toLowerCase().includes('powershell') || process.title.toLowerCase().includes('pwsh'))) {
|
|
219
208
|
shellPath = ['powershell'];
|
|
220
209
|
}
|
|
221
|
-
else if (this.windows &&
|
|
210
|
+
else if (this.windows &&
|
|
211
|
+
(process.title.toLowerCase().includes('command prompt') || process.title.toLowerCase().includes('cmd'))) {
|
|
222
212
|
shellPath = ['cmd.exe'];
|
|
223
213
|
}
|
|
224
214
|
else if (this.windows && COMSPEC) {
|