From 74ff87f46004553b798353e6f9b7ea44d8673ab5 Mon Sep 17 00:00:00 2001 From: Johannes Rudolph Date: Mon, 10 Aug 2020 14:06:22 +0200 Subject: [PATCH] Only access bar.tick when progress bar is enabled Fixes #24 --- index.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index ee2834e..663fe5c 100644 --- a/index.js +++ b/index.js @@ -36,7 +36,9 @@ module.exports = function asciidocLinkCheck(asciidoc, opts, callback) { linkCheckResult.link = link; linkCheckResult.statusCode = 0; linkCheckResult.status = 'ignored'; - bar.tick(); + if (opts.showProgressBar) { + bar.tick(); + } callback(null, linkCheckResult); return; } @@ -49,4 +51,4 @@ module.exports = function asciidocLinkCheck(asciidoc, opts, callback) { callback(err, result); }); }, callback); -}; \ No newline at end of file +};