From df8851fd944d4ac4397ccb8773d35f1099dec8dd Mon Sep 17 00:00:00 2001 From: yixiaojiu Date: Thu, 7 Aug 2025 00:58:59 +0800 Subject: [PATCH] fix: custom spec is not loaded correctly --- src/utils/config.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/utils/config.ts b/src/utils/config.ts index 82b158c..9b93fdc 100644 --- a/src/utils/config.ts +++ b/src/utils/config.ts @@ -101,7 +101,7 @@ let globalConfig: Config = { export const getConfig = (): Config => globalConfig; export const loadConfig = async (program: Command) => { - configPaths.forEach(async (configPath) => { + for (const configPath of configPaths) { if (fs.existsSync(configPath)) { let config: Config; try { @@ -122,13 +122,13 @@ export const loadConfig = async (program: Command) => { dismissSuggestions: config?.bindings?.dismissSuggestions ?? globalConfig.bindings.dismissSuggestions, }, specs: { - path: [...(config?.specs?.path ?? []), ...(config?.specs?.path ?? [])], + path: [...(config?.specs?.path ?? [])], }, useNerdFont: config?.useNerdFont ?? false, }; } - }); - globalConfig.specs = { path: [path.join(os.homedir(), ".fig", "autocomplete", "build"), ...(globalConfig.specs?.path ?? [])].map((p) => `file:\\${p}`) }; + } + globalConfig.specs = { path: [path.join(os.homedir(), ".fig", "autocomplete", "build"), ...(globalConfig.specs?.path ?? [])] }; }; export const deleteCacheFolder = (): void => {