We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7f7336b commit f8de721Copy full SHA for f8de721
sources/main.ts
@@ -38,6 +38,10 @@ function getPackageManagerRequestFromCli(parameter: string | undefined, engine:
38
};
39
}
40
41
+function isUsageError(error: any): error is UsageError {
42
+ return error?.name === `UsageError`;
43
+}
44
+
45
export async function runMain(argv: Array<string>) {
46
const engine = new Engine();
47
@@ -85,8 +89,8 @@ export async function runMain(argv: Array<string>) {
85
89
cwd: process.cwd(),
86
90
args: restArgs,
87
91
});
88
- } catch (error: UsageError | any) {
- if (error?.name === `UsageError`) {
92
+ } catch (error) {
93
+ if (isUsageError(error)) {
94
console.error(error.message);
95
process.exit(1);
96
0 commit comments