Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/utils/main/workerPool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,12 @@ const pendingPromises = new Map<
// During tests: workerPool.ts is in src/utils/main/ but worker is in dist/utils/main/
const currentDir = dirname(__filename);
const pathParts = currentDir.split(sep);
const hasDist = pathParts.includes("dist");
const srcIndex = pathParts.lastIndexOf("src");

let workerDir: string;
if (srcIndex !== -1) {
// Replace 'src' with 'dist' in the path
if (srcIndex !== -1 && !hasDist) {
// Replace 'src' with 'dist' in the path (only if not already in dist)
pathParts[srcIndex] = "dist";
workerDir = pathParts.join(sep);
} else {
Expand Down