Skip to content

Commit

Permalink
feat: improve the log and correct the path name using optimise command (
Browse files Browse the repository at this point in the history
#811)

Co-authored-by: Aayush <[email protected]>
  • Loading branch information
AayushSaini101 and aayushRedHat authored Sep 19, 2023
1 parent 54c0c92 commit b445ca7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/commands/optimize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ export default class Optimize extends Command {

const specPath = specFile.getFilePath();
let newPath = '';

if (specPath) {
const pos = specPath.lastIndexOf('.');
newPath = `${specPath.substring(0,pos) }_optimized.${ specPath.substring(pos+1)}`;
Expand All @@ -113,7 +114,8 @@ export default class Optimize extends Command {
this.log(`Created file ${newPath}...`);
} else if (this.outputMethod === Outputs.OVERWRITE) {
await writeFile(specPath ?? 'asyncapi.yaml', optimizedDocument, { encoding: 'utf8' });
this.log(`Created file ${newPath}...`);

this.log(`Updated file ${specPath}...`);
}
} catch (error) {
throw new ValidationError({
Expand Down

0 comments on commit b445ca7

Please sign in to comment.