Skip to content

Commit

Permalink
fix(core): check if content dir exists before removing
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosallexandre committed Feb 18, 2025
1 parent bdaa435 commit 95541f1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/catalog-to-astro-content-directory.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export const catalogToAstro = async (source, astroDir) => {
const astroContentDir = path.join(astroDir, 'src/content/');

// Clear the astro directory before we copy files over
fs.rmSync(astroContentDir, { recursive: true });
if (fs.existsSync(astroContentDir)) fs.rmSync(astroContentDir, { recursive: true });

// Create the folder again
fs.mkdirSync(astroContentDir);
Expand Down

0 comments on commit 95541f1

Please sign in to comment.