mirror of
https://gitlab.com/MrFry/mrfrys-node-server
synced 2026-04-28 11:17:38 +02:00
create path refactor, removed debug log
This commit is contained in:
@@ -21,11 +21,17 @@ type FileDescriptor = {
|
||||
description?: string
|
||||
errorIfMissing?: boolean
|
||||
warningIfMissing?: boolean
|
||||
isDir?: boolean
|
||||
}
|
||||
|
||||
export const validateAndSetupFiles = (): boolean => {
|
||||
let everythingValid = true
|
||||
Object.entries(files).forEach(([key, file]: [string, FileDescriptor]) => {
|
||||
if (file.isDir) {
|
||||
utils.CreatePath(file.path)
|
||||
return
|
||||
}
|
||||
|
||||
let fileExists = utils.FileExists(file.path)
|
||||
if (file.defaultValue != null && !fileExists) {
|
||||
// FIXME: create path too
|
||||
@@ -313,6 +319,14 @@ export const files = {
|
||||
keyFile: {
|
||||
path: 'data/p2p/key',
|
||||
},
|
||||
|
||||
// --------------------------------------------------------------------------------
|
||||
// user files
|
||||
// --------------------------------------------------------------------------------
|
||||
userFilesDir: {
|
||||
path: publicDir + 'userFiles',
|
||||
isDir: true,
|
||||
},
|
||||
} as const satisfies Record<string, FileDescriptor>
|
||||
|
||||
export const paths = Object.entries(files).reduce(
|
||||
|
||||
Reference in New Issue
Block a user