Merge pull request #120 from ntninja/fix-root-path-absolute

fix: Don’t forcefully make absolute rootPath relative to CWD
This commit is contained in:
Bruno Bernardino 2025-12-03 14:45:03 +00:00 committed by GitHub
commit e44a7a61e6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,3 +1,4 @@
import { join, isAbsolute } from '@std/path';
import { UserModel } from './models/user.ts';
import { Config, OptionalApp } from './types.ts';
@ -193,9 +194,11 @@ export class AppConfig {
static async getFilesRootPath(): Promise<string> {
await this.loadConfig();
const filesRootPath = `${Deno.cwd()}/${this.config.files.rootPath}`;
return filesRootPath;
if (isAbsolute(this.config.files.rootPath)) {
return this.config.files.rootPath;
} else {
return join(Deno.cwd(), this.config.files.rootPath);
}
}
static async getEmailConfig(): Promise<Config['email']> {