Skip to content

Commit b6e91aa

Browse files
committed
cmd-line fixes
1 parent 09de44f commit b6e91aa

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

bin/common.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ exports.command = clc.cyan;
2323
exports.commandContent = clc.magenta;
2424

2525
exports.showError = function(header, ex) {
26-
console.error(common.errorHeader(header));
27-
console.error(common.errorMessage(ex && ex.stack ? ex.stack : ex));
26+
console.error(exports.errorHeader(header));
27+
console.error(exports.errorMessage(ex && ex.stack ? ex.stack : ex));
2828
process.exit(1);
2929
};
3030

bin/compile.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ function ready() {
136136
var endTime = Date.now();
137137
} catch (ex) {
138138
console.log = logFunc;
139+
if (ex.loc) ex.message += " at " + ex.loc.start.line + ":" + ex.loc.start.column;
139140
common.showError("Could not execute AST", ex);
140141
}
141142

bin/parse.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@ if (code) {
8282
ready();
8383
} else if (process.argv.length > 2) {
8484
try {
85-
parseCode = fs.readFileSync(process.argv[2]);
85+
parseCode = fs.readFileSync(process.argv[2], 'utf8');
86+
ready();
8687
} catch (ex) {
8788
common.showError("Could not read MCA file", ex);
8889
}

0 commit comments

Comments
 (0)