1
0
Fork 0
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:
Starbeamrainbowlabs 2020-07-27 13:42:32 +01:00
parent 0ea03f7152
commit fc65659443
Signed by: sbrl
GPG key ID: 1BE5172E637709C2

View file

@ -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: