Skip to content

Commit f87c7f7

Browse files
authored
Merge pull request #13 from pfgray/fix_std_error_reporting
Output i18n errors to stderr instead of stdout
2 parents 19c18f3 + 7006f97 commit f87c7f7

3 files changed

Lines changed: 9 additions & 3 deletions

File tree

packages/i18nliner/lib/commands/check.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ Check.prototype.printSummary = function() {
8989
this.print("\n\n");
9090

9191
for (const error of errors) {
92-
this.print(red(error) + "\n");
92+
this.print(red(error) + "\n", 'error');
9393
}
9494

9595
this.print("\n");

packages/i18nliner/lib/commands/generic_command.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,12 @@ function GenericCommand(options) {
55
}
66
}
77

8-
GenericCommand.prototype.print = function(string) {
9-
process.stdout.write(string);
8+
GenericCommand.prototype.print = function(string, level) {
9+
if(level === 'error') {
10+
process.stderr.write(string);
11+
} else {
12+
process.stdout.write(string);
13+
}
1014
};
1115

1216
module.exports = GenericCommand;

packages/i18nliner/lib/config.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ const defaults = {
2222
processors: {},
2323

2424
plugins: [],
25+
26+
include: [],
2527
};
2628

2729
const config = {...defaults};

0 commit comments

Comments
 (0)