From ac563732320174cb79931344028d79df40dd52dc Mon Sep 17 00:00:00 2001 From: samirsilwal Date: Sat, 12 Oct 2024 09:04:13 +0545 Subject: [PATCH] Use path to get directory --- src/config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/config.ts b/src/config.ts index a4a75d23..2eedee2a 100644 --- a/src/config.ts +++ b/src/config.ts @@ -64,7 +64,7 @@ export async function loadConfig(configFilename: string = CONFIG_FILENAME): Prom validate(loaded); // Resolve the base path relative to the config file location. - const configFileLocation = filepath.split('/').slice(0, -1).join('/'); + const configFileLocation = path.dirname(filepath); const relativeBasePath = path.join(configFileLocation, loaded.basePath); const result = {