From d74dafbe0136637de56a9b04eff058a952820447 Mon Sep 17 00:00:00 2001 From: Slawomir Koszewski Date: Sat, 7 Mar 2026 10:51:19 +0100 Subject: [PATCH] update getConfig function to accept custom config file names --- src/config/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/config/index.ts b/src/config/index.ts index b12c1df..d2a3478 100644 --- a/src/config/index.ts +++ b/src/config/index.ts @@ -12,8 +12,8 @@ function getConfigDir(moduleName: string): string { return path.join(process.env.XDG_CONFIG_HOME ?? path.join(os.homedir(), ".config"), moduleName); } -export async function getConfig(moduleName: string): Promise { - const configPath = path.join(getConfigDir(moduleName), "config.json"); +export async function getConfig(moduleName: string, configName = "config"): Promise { + const configPath = path.join(getConfigDir(moduleName), `${configName}.json`); return readFile(configPath, "utf8") .then((configJson) => JSON.parse(configJson) as unknown)