@oclif/core 4.0.24 → 4.0.26
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 +3 -2
- package/lib/config/config.js +4 -4
- package/package.json +2 -2
package/lib/command.js
CHANGED
|
@@ -237,7 +237,8 @@ class Command {
|
|
|
237
237
|
// Since config.runHook will only run the hook for the root plugin, hookResult.successes will always have a length of 0 or 1
|
|
238
238
|
// But to be extra safe, we find the result that matches the root plugin.
|
|
239
239
|
const argvToParse = hookResult.successes?.length
|
|
240
|
-
? hookResult.successes.find((s) => s.plugin.root === cache_1.default.getInstance().get('rootPlugin')?.root)?.result ??
|
|
240
|
+
? (hookResult.successes.find((s) => s.plugin.root === cache_1.default.getInstance().get('rootPlugin')?.root)?.result ??
|
|
241
|
+
argv)
|
|
241
242
|
: argv;
|
|
242
243
|
this.argv = [...argvToParse];
|
|
243
244
|
const results = await Parser.parse(argvToParse, opts);
|
|
@@ -280,7 +281,7 @@ class Command {
|
|
|
280
281
|
const aliases = (0, util_2.uniq)([...(flagDef?.aliases ?? []), ...(flagDef?.charAliases ?? [])]).map((a) => a.length === 1 ? `-${a}` : `--${a}`);
|
|
281
282
|
if (aliases.length === 0)
|
|
282
283
|
return;
|
|
283
|
-
const foundAliases = aliases.filter((alias) => this.argv.
|
|
284
|
+
const foundAliases = aliases.filter((alias) => this.argv.includes(alias));
|
|
284
285
|
for (const alias of foundAliases) {
|
|
285
286
|
let preferredUsage = `--${flagDef?.name}`;
|
|
286
287
|
if (flagDef?.char) {
|
package/lib/config/config.js
CHANGED
|
@@ -28,7 +28,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
29
|
exports.Config = void 0;
|
|
30
30
|
const ejs = __importStar(require("ejs"));
|
|
31
|
-
const is_wsl_1 = __importDefault(require("is-wsl"));
|
|
32
31
|
const node_os_1 = require("node:os");
|
|
33
32
|
const node_path_1 = require("node:path");
|
|
34
33
|
const node_url_1 = require("node:url");
|
|
@@ -293,7 +292,8 @@ class Config {
|
|
|
293
292
|
this.channel = this.options.channel || channelFromVersion(this.version);
|
|
294
293
|
this.valid = this.rootPlugin.valid;
|
|
295
294
|
this.arch = (0, node_os_1.arch)() === 'ia32' ? 'x86' : (0, node_os_1.arch)();
|
|
296
|
-
|
|
295
|
+
const { default: isWSL } = await import('is-wsl');
|
|
296
|
+
this.platform = isWSL ? 'wsl' : (0, os_1.getPlatform)();
|
|
297
297
|
this.windows = this.platform === 'win32';
|
|
298
298
|
this.bin = this.pjson.oclif.bin || this.name;
|
|
299
299
|
this.binAliases = this.pjson.oclif.binAliases;
|
|
@@ -690,7 +690,7 @@ class Config {
|
|
|
690
690
|
// the new manifest yet. For those, we need to calculate the permutations here.
|
|
691
691
|
const permutations = this.flexibleTaxonomy && command.permutations === undefined
|
|
692
692
|
? (0, util_3.getCommandIdPermutations)(command.id)
|
|
693
|
-
: command.permutations ?? [command.id];
|
|
693
|
+
: (command.permutations ?? [command.id]);
|
|
694
694
|
// set every permutation
|
|
695
695
|
for (const permutation of permutations) {
|
|
696
696
|
this.commandPermutations.add(permutation, command.id);
|
|
@@ -711,7 +711,7 @@ class Config {
|
|
|
711
711
|
// the new manifest yet. For those, we need to calculate the permutations here.
|
|
712
712
|
const aliasPermutations = this.flexibleTaxonomy && command.aliasPermutations === undefined
|
|
713
713
|
? (0, util_3.getCommandIdPermutations)(alias)
|
|
714
|
-
: command.permutations ?? [alias];
|
|
714
|
+
: (command.permutations ?? [alias]);
|
|
715
715
|
// set every permutation
|
|
716
716
|
for (const permutation of aliasPermutations) {
|
|
717
717
|
this.commandPermutations.add(permutation, command.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": "4.0.
|
|
4
|
+
"version": "4.0.26",
|
|
5
5
|
"author": "Salesforce",
|
|
6
6
|
"bugs": "https://github.com/oclif/core/issues",
|
|
7
7
|
"dependencies": {
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"get-package-type": "^0.1.0",
|
|
15
15
|
"globby": "^11.1.0",
|
|
16
16
|
"indent-string": "^4.0.0",
|
|
17
|
-
"is-wsl": "^
|
|
17
|
+
"is-wsl": "^3",
|
|
18
18
|
"lilconfig": "^3.1.2",
|
|
19
19
|
"minimatch": "^9.0.5",
|
|
20
20
|
"semver": "^7.6.3",
|