From fd940220b44bba6829e82a894517692b67b8f584 Mon Sep 17 00:00:00 2001 From: Tylan Davis <89618855+tylandavis@users.noreply.github.com> Date: Fri, 10 May 2024 12:47:02 -0400 Subject: [PATCH] docs: fetchDocs script improvements * chore: improve error message in fetchDocs script * chore: filter out falsy docs --- scripts/fetch-docs.mjs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/fetch-docs.mjs b/scripts/fetch-docs.mjs index 8c96bcd76..d120643cb 100644 --- a/scripts/fetch-docs.mjs +++ b/scripts/fetch-docs.mjs @@ -123,7 +123,7 @@ const fetchDocs = async () => { return doc } catch (err) { const msg = err instanceof Error ? err.message : err || 'Unknown error' - console.error(`Error fetching ${docFilename}: ${msg}`) // eslint-disable-line no-console + console.error(`Error fetching ${topicSlug}/${docFilename} in ${ref}: ${msg}`) // eslint-disable-line no-console } }), ) @@ -147,7 +147,7 @@ const fetchDocs = async () => { }), ) - const data = JSON.stringify(topics, null, 2) + const data = JSON.stringify(topics.filter(Boolean), null, 2) const docsFilename = path.resolve(__dirname, outputDirectory)