aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorAndrew Harvey <andrew@alantgeo.com.au>2021-07-04 20:53:35 +1000
committerAndrew Harvey <andrew@alantgeo.com.au>2021-07-04 20:53:35 +1000
commit16e62a02bd6ea398a518cd89df432851dc81e22d (patch)
tree2e145367cb1d12114a1882d024f48712038d2595 /bin
parent3f5dccb9a6a1f443afedc2ab44fed61f8be4c712 (diff)
mrCoopDiff -n more to output the first n challenges only for debugging
Diffstat (limited to 'bin')
-rwxr-xr-xbin/mrCoopDiff.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/bin/mrCoopDiff.js b/bin/mrCoopDiff.js
index 080aa28..c3066a3 100755
--- a/bin/mrCoopDiff.js
+++ b/bin/mrCoopDiff.js
@@ -34,6 +34,11 @@ const applyOperations = new Transform({
transform(challenge, encoding, callback) {
challengeCount++
+ if (argv.n && challengeCount > argv.n) {
+ callback()
+ return
+ }
+
if (!argv.quiet) {
if (process.stdout.isTTY && challengeCount % 1000 === 0) {
process.stdout.write(` ${challengeCount.toLocaleString()}\r`)