Files
openchamber/packages/electron/scripts/after-pack.cjs
T
Bohdan Triapitsyn 3f3b835ee9 feat: add native macOS dynamic app icon (#1402)
* feat: add native macOS dynamic app icon

Adds Icon Composer source and compiled Assets.car for macOS
Packages the dynamic icon asset into the Electron app
Adds a script to regenerate macOS icon assets

* fix: harden macOS icon asset scripts
2026-05-24 21:23:46 +03:00

18 lines
670 B
JavaScript

const fs = require('node:fs');
const path = require('node:path');
module.exports = (context) => {
if (context.electronPlatformName !== 'darwin') return;
const appName = context.packager.appInfo.productFilename;
const appBundlePath = path.join(context.appOutDir, `${appName}.app`);
const resourcesPath = path.join(appBundlePath, 'Contents', 'Resources');
const sourceAssetsPath = path.join(__dirname, '..', 'resources', 'icons', 'Assets.car');
if (!fs.existsSync(sourceAssetsPath)) {
throw new Error(`Missing compiled app icon asset catalog at ${sourceAssetsPath}`);
}
fs.copyFileSync(sourceAssetsPath, path.join(resourcesPath, 'Assets.car'));
};