From ba5ccccdb26300adb481bfa6c804ce05b66a7297 Mon Sep 17 00:00:00 2001 From: Ben Date: Thu, 7 Sep 2023 10:56:18 +0100 Subject: [PATCH 1/2] fix: correct relative path calculation and add debug log --- src/executable.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/executable.ts b/src/executable.ts index aeee836..1aa9877 100644 --- a/src/executable.ts +++ b/src/executable.ts @@ -17,15 +17,22 @@ export function getCodingAssistantAssetsPath(): string { const executablePath = getExecutablePath(); const absoluteExecutablePath = path.isAbsolute(executablePath) ? executablePath - : path.join(process.cwd(), executablePath); + : path.join(__dirname, "..", executablePath); - return path.join( + let codingAssistantAssetsPath = path.join( absoluteExecutablePath, "..", "coding-assistant-app", "dist", "assets" ); + + console.log( + "Derived Sourcery Coding Assistant Assets Path: ", + codingAssistantAssetsPath + ) + + return codingAssistantAssetsPath; } export function getExecutablePath(): string { From aa84f1629ffb3e6541a1d6fd8ab3a64e37171aba Mon Sep 17 00:00:00 2001 From: Ben Date: Thu, 7 Sep 2023 11:01:48 +0100 Subject: [PATCH 2/2] style: prettier --- src/executable.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/executable.ts b/src/executable.ts index 1aa9877..3018cd9 100644 --- a/src/executable.ts +++ b/src/executable.ts @@ -30,7 +30,7 @@ export function getCodingAssistantAssetsPath(): string { console.log( "Derived Sourcery Coding Assistant Assets Path: ", codingAssistantAssetsPath - ) + ); return codingAssistantAssetsPath; }