Skip to content

Commit 08ffc48

Browse files
KurtPrestonamitguptagwl
authored andcommitted
CLI Tools fixes, part 2 (#114)
* Adding lib/parser.js to package.json to fix CLI tools * Fixing CLI * Non-zero exit code when CLI validation fails * Including src files since CLI references them
1 parent daa711c commit 08ffc48

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
3.12.0 / 2018-08-06
1+
3.12.1 / 2018-08-06
22
* Fix formatting for JSON to XML output
33
* Migrate to webpack
44
* fix cli

cli.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/*eslint-disable no-console*/
44
const fs = require("fs");
55
const path = require("path");
6-
const parser = require("./lib/parser");
6+
const parser = require("./src/parser");
77
const readToEnd = require("./src/read").readToEnd;
88

99
if (process.argv[2] === "--help" || process.argv[2] === "-h") {
@@ -74,14 +74,14 @@ if (process.argv[2] === "--help" || process.argv[2] === "-h") {
7474
if (err) {
7575
throw err;
7676
}
77-
callback(data);
77+
callback(data.toString());
7878
});
7979
} else {
8080
fs.readFile(fileName, function(err, data) {
8181
if (err) {
8282
throw err;
8383
}
84-
callback(data);
84+
callback(data.toString());
8585
});
8686
}
8787
}

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
"description": "Validate XML or Parse XML to JS/JSON very fast without C/C++ based libraries",
55
"main": "./src/parser.js",
66
"files": [
7-
"./lib/parser.js"
7+
"./cli.js",
8+
"./lib/parser.js",
9+
"./src/*.js"
810
],
911
"scripts": {
1012
"test": "jasmine spec/*spec.js",

0 commit comments

Comments
 (0)