diff options
author | Andrew Harvey <andrew@alantgeo.com.au> | 2021-05-16 18:57:07 +1000 |
---|---|---|
committer | Andrew Harvey <andrew@alantgeo.com.au> | 2021-05-16 18:57:07 +1000 |
commit | 426412dd82ac213d4427ad50591a907dc38574db (patch) | |
tree | 0da6274366e22f9ccfae0fe8eee3045801bb1332 /bin/reduceDuplicates.js | |
parent | 797ea370a4f72abe9d737e737c65040cbb5e7fc5 (diff) |
only log progress on TTY to avoid logging to gitlab ci
Diffstat (limited to 'bin/reduceDuplicates.js')
-rwxr-xr-x | bin/reduceDuplicates.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/bin/reduceDuplicates.js b/bin/reduceDuplicates.js index ab2cea6..e2ba562 100755 --- a/bin/reduceDuplicates.js +++ b/bin/reduceDuplicates.js @@ -40,7 +40,7 @@ const index = new Transform({ transform(feature, encoding, callback) { sourceCount++ - if (sourceCount % 10000 === 0) { + if (process.stdout.isTTY && sourceCount % 10000 === 0) { process.stdout.write(` ${sourceCount / 1000}k\r`) } @@ -70,7 +70,7 @@ const reduce = new Transform({ writableObjectMode: true, transform(key, encoding, callback) { reduceIndex++ - if (reduceIndex % 10000 === 0) { + if (process.stdout.isTTY && reduceIndex % 10000 === 0) { process.stdout.write(` ${reduceIndex / 1000}k / ${Math.round(sourceCount / 1000)}k (${Math.round(reduceIndex / sourceCount * 100)}%)\r`) } |