From a29313febabdb83b8dc60813fc294113ce6296de Mon Sep 17 00:00:00 2001 From: Brandon Istenes Date: Wed, 16 Jun 2021 16:16:14 -0700 Subject: [PATCH] Indent console output for each file --- markdown-link-check | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/markdown-link-check b/markdown-link-check index 65fc79c..17cbdfe 100755 --- a/markdown-link-check +++ b/markdown-link-check @@ -141,13 +141,13 @@ stream function runMarkdownLinkCheck(markdown, opts) { markdownLinkCheck(markdown, opts, function (err, results) { if (err) { - console.error(chalk.red('\nERROR: something went wrong!')); + console.error(chalk.red('\n ERROR: something went wrong!')); console.error(err.stack); process.exit(1); } if (results.length === 0 && !opts.quiet) { - console.log(chalk.yellow('No hyperlinks found!')); + console.log(chalk.yellow(' No hyperlinks found!')); } results.forEach(function (result) { // Skip messages for non-deadlinks in quiet mode. @@ -157,21 +157,21 @@ function runMarkdownLinkCheck(markdown, opts) { if (opts.verbose) { if (result.err) { - console.log('[%s] %s → Status: %s %s', statusLabels[result.status], result.link, result.statusCode, result.err); + console.log(' [%s] %s → Status: %s %s', statusLabels[result.status], result.link, result.statusCode, result.err); } else { - console.log('[%s] %s → Status: %s', statusLabels[result.status], result.link, result.statusCode); + console.log(' [%s] %s → Status: %s', statusLabels[result.status], result.link, result.statusCode); } } else { - console.log('[%s] %s', statusLabels[result.status], result.link); + console.log(' [%s] %s', statusLabels[result.status], result.link); } }); - console.log('\n%s links checked.', results.length); + console.log('\n %s links checked.', results.length); if (results.some((result) => result.status === 'dead')) { let deadLinks = results.filter(result => { return result.status === 'dead'; }); - console.error(chalk.red('\nERROR: %s dead links found!'), deadLinks.length); + console.error(chalk.red('\n ERROR: %s dead links found!'), deadLinks.length); deadLinks.forEach(function (result) { - console.log('[%s] %s → Status: %s', statusLabels[result.status], result.link, result.statusCode); + console.log(' [%s] %s → Status: %s', statusLabels[result.status], result.link, result.statusCode); }); process.exit(1); }