mirror of
https://github.com/sbrl/terrain50-cli.git
synced 2024-11-26 07:33:00 +00:00
validate: write final stats to stderr
This commit is contained in:
parent
0ea03f7152
commit
fc65659443
1 changed files with 5 additions and 2 deletions
|
@ -16,12 +16,15 @@ export default async function(settings) {
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "stream":
|
case "stream":
|
||||||
let i = 0
|
let i = 0, ok = 0, failed = 0;
|
||||||
for await (let next of Terrain50.ParseStream(process.stdin, settings.cli.use_regex ? /\s+/ : " ")) {
|
for await (let next of Terrain50.ParseStream(process.stdin, settings.cli.use_regex ? /\s+/ : " ")) {
|
||||||
console.log(`>>> Item ${i} <<<`);
|
console.log(`>>> Item ${i} <<<`);
|
||||||
display_errors(next.validate());
|
let result = next.validate();
|
||||||
|
display_errors(result);
|
||||||
|
if(result.length > 0) failed++; else ok++;
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
console.error(`${a.fgreen}${a.hicol}Parsed ${i} items (${ok} ok, ${failed} failed)`)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|
Loading…
Reference in a new issue