mirror of
https://github.com/tiddly-gittly/TidGi-Desktop.git
synced 2025-12-06 10:41:02 -08:00
fix: assign LOCAL_GIT_DIRECTORY to point to actural git folder in packaged electron
https://github.com/desktop/dugite/issues/96
This commit is contained in:
parent
7c30ef4ca0
commit
b05c38b72d
2 changed files with 3 additions and 0 deletions
|
|
@ -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');
|
||||
|
|
|
|||
|
|
@ -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<void> {
|
||||
process.env.LOCAL_GIT_DIRECTORY = LOCAL_GIT_DIRECTORY;
|
||||
this.gitWorker = await spawn<GitWorker>(new Worker(workerURL));
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue