From 95541f1a62598f48a7c3f19e3e4997b16034009a Mon Sep 17 00:00:00 2001 From: carlosallexandre Date: Tue, 18 Feb 2025 09:34:24 -0300 Subject: [PATCH] fix(core): check if content dir exists before removing --- src/catalog-to-astro-content-directory.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/catalog-to-astro-content-directory.js b/src/catalog-to-astro-content-directory.js index 780486d5..349b0694 100644 --- a/src/catalog-to-astro-content-directory.js +++ b/src/catalog-to-astro-content-directory.js @@ -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);