@clerc/plugin-not-found 0.42.0 → 0.42.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/dist/index.js +6 -6
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -24,16 +24,16 @@ const notFoundPlugin = () => definePlugin({
|
|
|
24
24
|
add(locales);
|
|
25
25
|
return cli.inspector({
|
|
26
26
|
enforce: "pre",
|
|
27
|
-
fn: (
|
|
27
|
+
fn: (ctx, next) => {
|
|
28
28
|
const commandKeys = Object.keys(cli._commands);
|
|
29
29
|
const hasCommands = commandKeys.length > 0;
|
|
30
30
|
try {
|
|
31
31
|
next();
|
|
32
|
-
} catch (
|
|
33
|
-
if (!(
|
|
34
|
-
throw
|
|
32
|
+
} catch (e) {
|
|
33
|
+
if (!(e instanceof NoSuchCommandError || e instanceof NoCommandGivenError)) {
|
|
34
|
+
throw e;
|
|
35
35
|
}
|
|
36
|
-
if (
|
|
36
|
+
if (ctx.raw._.length === 0 || e instanceof NoCommandGivenError) {
|
|
37
37
|
console.error(t("core.noCommandGiven"));
|
|
38
38
|
if (hasCommands) {
|
|
39
39
|
console.error(
|
|
@@ -45,7 +45,7 @@ const notFoundPlugin = () => definePlugin({
|
|
|
45
45
|
}
|
|
46
46
|
return;
|
|
47
47
|
}
|
|
48
|
-
const calledCommandName =
|
|
48
|
+
const calledCommandName = e.commandName;
|
|
49
49
|
const closestCommandName = didyoumean(
|
|
50
50
|
calledCommandName,
|
|
51
51
|
commandKeys
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@clerc/plugin-not-found",
|
|
3
|
-
"version": "0.42.
|
|
3
|
+
"version": "0.42.1",
|
|
4
4
|
"author": "Ray <i@mk1.io> (https://github.com/so1ve)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "Clerc plugin not found (did you mean)",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"dependencies": {
|
|
51
51
|
"didyoumean2": "^5.0.0",
|
|
52
52
|
"yoctocolors": "^1.0.0",
|
|
53
|
-
"@clerc/utils": "0.42.
|
|
53
|
+
"@clerc/utils": "0.42.1"
|
|
54
54
|
},
|
|
55
55
|
"peerDependencies": {
|
|
56
56
|
"@clerc/core": "*"
|