testing: display path availability on screen
Some checks failed
InnoHub Processor/tatort/pipeline/head There was a failure building this commit
Some checks failed
InnoHub Processor/tatort/pipeline/head There was a failure building this commit
This commit is contained in:
@@ -5,11 +5,14 @@ import { ROUTE_NAMES } from '..';
|
||||
|
||||
import fs from 'fs';
|
||||
const path = '/daten';
|
||||
let path_existing: string;
|
||||
|
||||
fs.access(path, fs.constants.F_OK, (err) => {
|
||||
if (err) {
|
||||
path_existing = "NO";
|
||||
console.error(`❌ Directory "${path}" does NOT exist or is not accessible.`);
|
||||
} else {
|
||||
path_existing = "YES";
|
||||
console.log(`✅ Directory "${path}" exists and is accessible.`);
|
||||
}
|
||||
});
|
||||
@@ -18,6 +21,7 @@ export const load: PageServerLoad = (event: ServerLoadEvent) => {
|
||||
if (!event.locals.user && event.url.pathname !== ROUTE_NAMES.ANMELDUNG)
|
||||
throw redirect(303, ROUTE_NAMES.ANMELDUNG);
|
||||
return {
|
||||
user: event.locals.user
|
||||
user: event.locals.user,
|
||||
path_existing
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user