diff --git a/src/constants/appPaths.ts b/src/constants/appPaths.ts index ae3f4ffb1..64bd3ae61 100644 --- a/src/constants/appPaths.ts +++ b/src/constants/appPaths.ts @@ -7,3 +7,4 @@ export const SETTINGS_FOLDER = isDevelopmentOrTest ? path.resolve(sourcePath, '..', developmentSettingFolderName) : // eslint-disable-next-line @typescript-eslint/no-var-requires path.resolve(require('electron').app.getPath('userData'), 'settings'); +export const LOCAL_GIT_DIRECTORY = isDevelopmentOrTest ? undefined : path.resolve(process.resourcesPath, 'node_modules', 'dugite', 'git'); diff --git a/src/services/git/index.ts b/src/services/git/index.ts index f2ab255f6..cf6b5ac41 100644 --- a/src/services/git/index.ts +++ b/src/services/git/index.ts @@ -29,6 +29,7 @@ import { Observer } from 'rxjs'; // @ts-expect-error it don't want .ts // eslint-disable-next-line import/no-webpack-loader-syntax import workerURL from 'threads-plugin/dist/loader?name=gitWorker!./gitWorker.ts'; +import { LOCAL_GIT_DIRECTORY } from '@/constants/appPaths'; @injectable() export class Git implements IGitService { @@ -46,6 +47,7 @@ export class Git implements IGitService { } private async initWorker(): Promise { + process.env.LOCAL_GIT_DIRECTORY = LOCAL_GIT_DIRECTORY; this.gitWorker = await spawn(new Worker(workerURL)); }