From 9e3c60afaad01954dcc053af2c0be8a6f3995d48 Mon Sep 17 00:00:00 2001 From: Simon Holthausen Date: Sat, 2 Nov 2024 10:59:47 +0100 Subject: [PATCH] chore: warn instead of error when no linked repo found Not everyone might be interested in having all repos locally linked up, and only care about locally syncing/updating specific repos at a time. That's currently not possible because the sync script error with a somewhat hard to understand error, because it can't find a certain repo. This adds a dedicated check and shows a warning instead of erroring. --- apps/svelte.dev/scripts/sync-docs/index.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/apps/svelte.dev/scripts/sync-docs/index.ts b/apps/svelte.dev/scripts/sync-docs/index.ts index 4866a41787..c2cccb82c6 100644 --- a/apps/svelte.dev/scripts/sync-docs/index.ts +++ b/apps/svelte.dev/scripts/sync-docs/index.ts @@ -167,6 +167,11 @@ if (parsed.values.pull) { } async function sync(pkg: Package) { + if (!fs.existsSync(`${REPOS}/${pkg.name}/${pkg.docs}`)) { + console.warn(`No linked repo found for ${pkg.name}`); + return; + } + const dest = `${DOCS}/${pkg.name}`; fs.rmSync(dest, { force: true, recursive: true });