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 77b504e commit 32b7262Copy full SHA for 32b7262
src/apps/cli/commands/generate/fromTemplate.ts
@@ -59,6 +59,20 @@ export default class Template extends BaseGeneratorCommand {
59
60
const asyncapiInput = await this.loadAsyncAPIInput(asyncapi);
61
62
+ const content =
63
+ typeof asyncapiInput === 'string'
64
+ ? asyncapiInput
65
+ : asyncapiInput?.toString?.() ?? '';
66
+
67
+ if (content.trim().length === 0) {
68
+ return this.error(
69
+ new ValidationError({
70
+ type: 'invalid-file',
71
+ filepath: asyncapi,
72
+ }),
73
+ { exit: 1 },
74
+ );
75
+ }
76
this.specFile = asyncapiInput;
77
this.metricsMetadata.template = template;
78
0 commit comments