Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .changeset/fix-broken-docs-links.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"@asyncapi/cli": patch
---

docs: fix broken links in DEVELOPMENT.md and installation guide

- Update git-workflow.md link in DEVELOPMENT.md to new path in asyncapi/community repo
- Remove outdated asyncapi.x86.exe download link from installation guide as 32-bit Windows executable is no longer distributed
5 changes: 5 additions & 0 deletions .changeset/fix-duplicate-spec-loading.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@asyncapi/cli": patch
---

fix: remove duplicate AsyncAPI specification loading in fromTemplate command
2 changes: 1 addition & 1 deletion DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ git clone https://github.com/{your_username}/cli.git
cd cli
```

After cloning the repository, you should setup the fork properly and configure the `remote` repository as described [here](https://github.com/asyncapi/community/blob/master/git-workflow.md)
After cloning the repository, you should setup the fork properly and configure the `remote` repository as described [here](https://github.com/asyncapi/community/blob/master/docs/010-contribution-guidelines/git-workflow.md)

2. Install dependencies:

Expand Down
2 changes: 1 addition & 1 deletion docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ All the AsyncAPI CLI versions can be found [here](https://chocolatey.org/package

Just install the appropriate installer and simply follow the default installation steps to complete the installation process.

Download [asyncapi.x64.exe](https://github.com/asyncapi/cli/releases/latest/download/asyncapi.x64.exe) for 64-bit Windows and download [asyncapi.x86.exe](https://github.com/asyncapi/cli/releases/latest/download/asyncapi.x86.exe) for 32-bit Windows.
Download [asyncapi.x64.exe](https://github.com/asyncapi/cli/releases/latest/download/asyncapi.x64.exe) for 64-bit Windows.


## Linux
Expand Down
20 changes: 8 additions & 12 deletions src/apps/cli/commands/generate/fromTemplate.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Args } from '@oclif/core';
import { BaseGeneratorCommand } from '@cli/internal/base/BaseGeneratorCommand';
import { load, Specification } from '@models/SpecificationFile';
import { ValidationError } from '@errors/validation-error';
import { GeneratorError } from '@errors/generator-error';
import { intro } from '@clack/prompts';
Expand Down Expand Up @@ -57,28 +56,25 @@ export default class Template extends BaseGeneratorCommand {
// Apply proxy configuration using base class method
asyncapi = this.applyProxyConfiguration(asyncapi, proxyHost, proxyPort);

const asyncapiInput = await this.loadAsyncAPIInput(asyncapi);

this.specFile = asyncapiInput;
this.metricsMetadata.template = template;

const watchTemplate = flags['watch'];
const genOption = this.buildGenOption(flags, parsedFlags);

let specification: Specification;
let specification;
try {
specification = await load(asyncapi);
specification = await this.loadAsyncAPIInput(asyncapi);
} catch {
return this.error(
new ValidationError({

type: 'invalid-file',
filepath: asyncapi,
}),
{ exit: 1 },
);
}

this.specFile = specification;
this.metricsMetadata.template = template;

const watchTemplate = flags['watch'];
const genOption = this.buildGenOption(flags, parsedFlags);

const result = await this.generatorService.generate(
specification,
template,
Expand Down
Loading