mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2026-04-18 23:49:20 +01:00
15 lines
461 B
TypeScript
15 lines
461 B
TypeScript
// 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, '..', '..');
|
|
}
|