Skip to content

Commit 8d9f96c

Browse files
authored
Merge pull request Expensify#72781 from Expensify/michal-electron-icons-fix
Fix Electron icons
2 parents e971c3d + cf55ec9 commit 8d9f96c

13 files changed

Lines changed: 208 additions & 6 deletions

File tree

cspell.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"--longpress",
55
"Accelo",
66
"achreimburse",
7+
"actool",
78
"adbd",
89
"ADDCOMMENT",
910
"Addendums",

desktop/Assets-adhoc.car

-141 KB
Binary file not shown.

desktop/Assets-dev.car

-140 KB
Binary file not shown.

desktop/Assets.car

376 KB
Binary file not shown.

desktop/AssetsAdhoc.car

828 KB
Binary file not shown.

desktop/AssetsDev.car

816 KB
Binary file not shown.

desktop/AssetsStaging.car

818 KB
Binary file not shown.

desktop/afterPack.ts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,21 @@ import type {AfterPackContext} from 'electron-builder';
22
import {promises as fs} from 'node:fs';
33
import path from 'node:path';
44

5-
const getAssetSourceFilename = () => {
5+
const getAssetSuffix = () => {
66
if (process.env.ELECTRON_ENV === 'adhoc') {
7-
return 'Assets-adhoc.car';
7+
return 'Adhoc';
88
}
99

1010
if (process.env.ELECTRON_ENV === 'development') {
11-
return 'Assets-dev.car';
11+
return 'Dev';
1212
}
1313

14-
return 'Assets.car';
15-
};
14+
if (process.env.ELECTRON_ENV === 'staging') {
15+
return 'Staging';
16+
}
1617

17-
const assetSource = path.resolve(__dirname, `../${getAssetSourceFilename()}`);
18+
return '';
19+
};
1820

1921
// This will copy Assets.car with MacOS Liquid Glass icon
2022
// and will be removed after Electron builder supports this natively
@@ -27,5 +29,7 @@ export default function afterPack(context: AfterPackContext) {
2729
const appRoot = path.join(context.appOutDir, `${appName}.app`, 'Contents');
2830
const resourcesDir = path.join(appRoot, 'Resources');
2931

32+
const assetSource = path.resolve(__dirname, `../Assets${getAssetSuffix()}.car`);
33+
3034
return fs.mkdir(resourcesDir, {recursive: true}).then(() => fs.copyFile(assetSource, path.join(resourcesDir, 'Assets.car')));
3135
}
10.3 KB
Loading
21.5 KB
Loading

0 commit comments

Comments
 (0)