Remove use of __dirname from main process

This commit is contained in:
Fedor Indutny
2026-03-27 10:55:37 -07:00
committed by GitHub
parent 70f111e868
commit a048f83dbc
39 changed files with 222 additions and 337 deletions

View File

@@ -0,0 +1,14 @@
// Copyright 2026 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import { app } from 'electron';
import { join } from 'node:path';
export function getAppRootDir(): string {
// We have this logic because test-node runs under `electron-mocha` that has
// `app.getAppPath()` pointing within `electron-mocha`'s folder.
if (app.isPackaged || process.env.IS_BUNDLED) {
return app.getAppPath();
}
return join(__dirname, '..', '..');
}