From 126e7ec8d0c29eb3dbff478bb3d8bc8897324335 Mon Sep 17 00:00:00 2001 From: linonetwo Date: Sat, 6 Dec 2025 15:08:55 +0800 Subject: [PATCH] fix: different out path on macos --- src/constants/paths.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/constants/paths.ts b/src/constants/paths.ts index 4429d03c..a33f0c82 100644 --- a/src/constants/paths.ts +++ b/src/constants/paths.ts @@ -81,9 +81,12 @@ export const LOCALIZATION_FOLDER = isPackaged // Default wiki locations // For E2E tests, always use project root's wiki-test (outside asar) -// process.resourcesPath: out/TidGi-.../resources -> need ../../.. to get to project root +// Windows/Linux: process.resourcesPath = out/TidGi-.../resources -> need ../../.. (3 levels) to get to project root +// macOS: process.resourcesPath = out/TidGi-darwin-x64/TidGi.app/Contents/Resources -> need ../../../../../ (5 levels) to get to project root export const DEFAULT_FIRST_WIKI_FOLDER_PATH = isTest && isPackaged - ? path.resolve(process.resourcesPath, '..', '..', '..', testWikiFolderName) // E2E packaged: project root + ? (isMac + ? path.resolve(process.resourcesPath, '..', '..', '..', '..', '..', testWikiFolderName) // macOS E2E: 5 levels up + : path.resolve(process.resourcesPath, '..', '..', '..', testWikiFolderName)) // Windows/Linux E2E: 3 levels up : isTest ? path.resolve(__dirname, '..', '..', testWikiFolderName) // E2E dev: project root : isDevelopmentOrTest