Skip to content

Commit

Permalink
fix: fix memfs tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Princesseuh committed Aug 15, 2024
1 parent fa0ec84 commit 8036d97
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions packages/astro/src/content/types-generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -590,11 +590,9 @@ async function writeContentFiles({

// If it's the first time, we inject types the usual way. sync() will handle creating files and references. If it's not the first time, we just override the dts content
if (settings.injectedTypes.some((t) => t.filename === CONTENT_TYPES_FILE)) {
fs.promises.writeFile(
new URL(CONTENT_TYPES_FILE, settings.dotAstroDir),
typeTemplateContent,
'utf-8',
);
const filePath = fileURLToPath(new URL(CONTENT_TYPES_FILE, settings.dotAstroDir));
await fs.promises.mkdir(path.dirname(filePath), { recursive: true });
await fs.promises.writeFile(filePath, typeTemplateContent, 'utf-8');
} else {
settings.injectedTypes.push({
filename: CONTENT_TYPES_FILE,
Expand Down

0 comments on commit 8036d97

Please sign in to comment.