Skip to content

Commit

Permalink
Linux icon
Browse files Browse the repository at this point in the history
  • Loading branch information
viktor44 committed Feb 10, 2024
1 parent b8cd2a7 commit 94eb992
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions app/utils/resources.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
import * as fs from 'fs';
import * as path from 'path';

const getResourcePath = (rootPath: string) => path.resolve(__dirname, '../..', rootPath);
import { isLinux } from './process';

/**
* Returns the full path of the PNG icon of the app
*/
export const getResourceIconPath = () => {
const stableIconPath = getResourcePath('resources/icon.png');
if (fs.existsSync(stableIconPath)) return stableIconPath;

if (isLinux) {
const stableIconPath = path.resolve(__dirname, '../../resources/icon.png');
if (fs.existsSync(stableIconPath)) {
return stableIconPath;
}
}
return undefined;
};

0 comments on commit 94eb992

Please sign in to comment.