mirror of
https://github.com/kremalicious/portfolio.git
synced 2024-12-22 09:13:19 +01:00
make sure projectsOutput exists
This commit is contained in:
parent
0901a3659b
commit
8f8bb23789
@ -24,6 +24,12 @@ export async function generateProjects(): Promise<void> {
|
|||||||
if (project) projects.push(project)
|
if (project) projects.push(project)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const dirPath = path.dirname(projectsOutput)
|
||||||
|
|
||||||
|
if (!fs.existsSync(dirPath)) {
|
||||||
|
fs.mkdirSync(dirPath, { recursive: true })
|
||||||
|
}
|
||||||
|
|
||||||
fs.writeFileSync(projectsOutput, JSON.stringify(projects, null, 2))
|
fs.writeFileSync(projectsOutput, JSON.stringify(projects, null, 2))
|
||||||
spinner.succeed(`Projects content written to ${projectsOutput}\n`)
|
spinner.succeed(`Projects content written to ${projectsOutput}\n`)
|
||||||
} catch (error: unknown) {
|
} catch (error: unknown) {
|
||||||
|
Loading…
Reference in New Issue
Block a user