From 641b837e7d4daf7810e4fdcbed84c8b020852e22 Mon Sep 17 00:00:00 2001 From: CanadaHonk Date: Mon, 11 Mar 2024 14:27:54 +0000 Subject: [PATCH] fix: fix crash #297 --- markdown-link-check | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/markdown-link-check b/markdown-link-check index 9f0990d..32303a7 100755 --- a/markdown-link-check +++ b/markdown-link-check @@ -64,6 +64,8 @@ function getInputs() { } } + const { ignore } = program.opts(); + for (const filenameOrUrl of filenamesOrUrls) { filenameForOutput = filenameOrUrl; let baseUrl = ''; @@ -94,7 +96,7 @@ function getInputs() { // skip paths given if it includes a path to ignore. // todo: allow ignore paths to be glob or regex instead of just includes? - if (program.opts().ignore.some((ignorePath) => resolved.includes(ignorePath))) { + if (ignore && ignore.some((ignorePath) => resolved.includes(ignorePath))) { continue; }