diff --git a/src/server/actions/simple-git.ts b/src/server/actions/simple-git.ts index 263ad60..0f34948 100644 --- a/src/server/actions/simple-git.ts +++ b/src/server/actions/simple-git.ts @@ -1,7 +1,7 @@ 'use server'; import 'server-only'; -import { existsSync, readdirSync, writeFileSync } from 'fs'; +import { existsSync, mkdirSync, readdirSync, writeFileSync } from 'fs'; import { join } from 'path'; import simpleGit from 'simple-git'; @@ -17,6 +17,10 @@ const LOCAL_REPOSITORY_PATH = process.env.NODE_ENV === 'production' ? '/var/www/html/data.faithfulmods.net/textures/' : process.env.DEV_LOCAL_REPOSITORY_PATH!; +if (!existsSync(LOCAL_REPOSITORY_PATH)) { + mkdirSync(LOCAL_REPOSITORY_PATH, { recursive: true }); +} + const git = simpleGit(LOCAL_REPOSITORY_PATH); /**