From dfd2e06a44e07c054fb9cb20d097f459c0dadbe8 Mon Sep 17 00:00:00 2001 From: Todd Parsons Date: Fri, 12 Jul 2024 17:28:22 +0100 Subject: [PATCH] feat: Look for config file in .vscode folder too fixes #2 --- src/extension.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/extension.ts b/src/extension.ts index e024341..d91dda4 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -50,7 +50,12 @@ export function activate(context: vscode.ExtensionContext) { } async function getConfigJson() { - const config = await getJsonFile(`${cwd}/script-buttons.json`); + try { + const config = await getJsonFile(`${cwd}/script-buttons.json`); + } catch { + console.log('No script-buttons.json found in working directory, trying .vscode folder...'); + const config = await getJsonFile(`${cwd}/.vscode/script-buttons.json`); + } return config; }