feat: use environment variable for uploads directory path
All checks were successful
Build Docker Image / build (push) Successful in 1m26s

This commit is contained in:
2026-03-02 23:21:05 +01:00
parent 6cd18992f6
commit 2b4a55636e
2 changed files with 4 additions and 2 deletions

View File

@@ -6,6 +6,7 @@ import type { PageServerLoad, Actions } from './$types';
import { writeFile } from 'fs/promises';
import { join } from 'path';
import { existsSync, mkdirSync } from 'fs';
import { env } from '$env/dynamic/private';
export const load: PageServerLoad = async () => {
const [charactersData, devilFruits, arcs, overrides] = await Promise.all([
@@ -109,7 +110,7 @@ export const actions: Actions = {
const hasUploadedPicture = !!pictureFile && pictureFile.size > 0;
if (hasUploadedPicture) {
try {
const uploadsDir = join(process.cwd(), 'uploads');
const uploadsDir = join(process.cwd(), env.UPLOAD_FOLDER || 'uploads');
if (!existsSync(uploadsDir)) {
mkdirSync(uploadsDir, { recursive: true });
}