Skip to content

Commit

Permalink
#711 Removed string formating on cli output (#712)
Browse files Browse the repository at this point in the history
* #711 Removed string formating on cli output

* Updated to fix regression of issue in #701
  • Loading branch information
angeld7 authored Feb 20, 2025
1 parent 7783341 commit dd9a94b
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/cli/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,23 +46,21 @@ if (process.argv[2] === '--help' || process.argv[2] === '-h') {

const callback = function(xmlData) {
let output = '';
if (validate) {
const parser = new XMLParser(options);
output = parser.parse(xmlData,validate);
} else if (validateOnly) {
if (validateOnly) {
output = XMLValidator.validate(xmlData);
process.exitCode = output === true ? 0 : 1;
} else {
} else {
const parser = new XMLParser(options);
output = JSON.stringify(parser.parse(xmlData,validate), null, 4);
}
if (outputFileName) {
writeToFile(outputFileName, output);
} else {
console.log(JSON.stringify(output, null, 2));
console.log(output);
}
};


try {

if (!fileName) {
Expand Down

0 comments on commit dd9a94b

Please sign in to comment.