mirror of
https://github.com/balena-io/etcher.git
synced 2025-04-22 14:27:18 +00:00
13 lines
495 B
TypeScript
13 lines
495 B
TypeScript
export function getAppPath(): string {
|
|
return (
|
|
(require('electron').app || require('@electron/remote').app)
|
|
.getAppPath()
|
|
// With macOS universal builds, getAppPath() returns the path to an app.asar file containing an index.js file which will
|
|
// include the app-x64 or app-arm64 folder depending on the arch.
|
|
// We don't care about the app.asar file, we want the actual folder.
|
|
.replace(/\.asar$/, () =>
|
|
process.platform === 'darwin' ? '-' + process.arch : '',
|
|
)
|
|
);
|
|
}
|