@asyncapi/cli 0.39.2 → 0.40.0

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.
@@ -19,6 +19,7 @@ class Convert extends base_1.default {
19
19
  const filePath = args['spec-file'];
20
20
  let specFile;
21
21
  let convertedFile;
22
+ let convertedFileFormatted;
22
23
  try {
23
24
  // LOAD FILE
24
25
  specFile = yield (0, SpecificationFile_1.load)(filePath);
@@ -32,11 +33,17 @@ class Convert extends base_1.default {
32
33
  this.log(`URL ${specFile.getFileURL()} successfully converted!`);
33
34
  }
34
35
  }
36
+ if (typeof convertedFile === 'object') {
37
+ convertedFileFormatted = JSON.stringify(convertedFile, null, 4);
38
+ }
39
+ else {
40
+ convertedFileFormatted = convertedFile;
41
+ }
35
42
  if (flags.output) {
36
- yield fs_1.promises.writeFile(`${flags.output}`, convertedFile, { encoding: 'utf8' });
43
+ yield fs_1.promises.writeFile(`${flags.output}`, convertedFileFormatted, { encoding: 'utf8' });
37
44
  }
38
45
  else {
39
- this.log(convertedFile);
46
+ this.log(convertedFileFormatted);
40
47
  }
41
48
  }
42
49
  catch (err) {
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.39.2",
2
+ "version": "0.40.0",
3
3
  "commands": {
4
4
  "bundle": {
5
5
  "id": "bundle",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@asyncapi/cli",
3
3
  "description": "All in one CLI for all AsyncAPI tools",
4
- "version": "0.39.2",
4
+ "version": "0.40.0",
5
5
  "author": "@asyncapi",
6
6
  "bin": {
7
7
  "asyncapi": "./bin/run"