From 983ddae06274e4975a0352d7e0850d9984fbac4e Mon Sep 17 00:00:00 2001 From: Abdellah Hariti Date: Thu, 25 Jul 2024 14:53:46 +0100 Subject: [PATCH] chagne report working --- scripts/lint-404s/main.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/lint-404s/main.ts b/scripts/lint-404s/main.ts index af3bddc2ff74a..d2c34e9fe48f0 100644 --- a/scripts/lint-404s/main.ts +++ b/scripts/lint-404s/main.ts @@ -125,9 +125,11 @@ async function main() { console.log('\n\nšŸŽ‰ No 404s found'); return false; } + const numberOf404s = all404s.map(x => x.page404s.length).reduce((a, b) => a + b, 0); console.log( - '\nāŒ Found %d 404s across %d %s', - all404s.map(x => x.page404s.length).reduce((a, b) => a + b, 0), + '\nāŒ Found %d %s across %d %s', + numberOf404s, + numberOf404s === 1 ? '404' : '404s', all404s.length, all404s.length === 1 ? 'page' : 'pages' );