Skip to content

Commit

Permalink
fix: assign LOCAL_GIT_DIRECTORY to point to actural git folder in pac…
Browse files Browse the repository at this point in the history
…kaged electron

desktop/dugite#96
  • Loading branch information
linonetwo committed Jul 25, 2021
1 parent 7c30ef4 commit b05c38b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/constants/appPaths.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
2 changes: 2 additions & 0 deletions src/services/git/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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));
}

Expand Down

0 comments on commit b05c38b

Please sign in to comment.