Skip to content

Commit

Permalink
chore: warn instead of error when no linked repo found (#762)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
dummdidumm authored Nov 2, 2024
1 parent 5b0d552 commit e089aaf
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions apps/svelte.dev/scripts/sync-docs/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
Expand Down

0 comments on commit e089aaf

Please sign in to comment.