Files
2026-07-13 13:12:00 +08:00

21 lines
874 B
JavaScript

// electron-builder afterPack hook.
//
// macOS: copies the precompiled Assets.car (built from icons/AppIcon.icon
// via `actool`, see icons/README.md) into the app bundle's Resources so
// macOS 26+ renders the native liquid-glass app icon. Older macOS falls
// back to icons/icon.icns (also generated by actool from the same .icon).
// The hook runs before code signing, so the added file gets sealed into
// the signature.
const fs = require("fs");
const path = require("path");
module.exports = async function afterPack(context) {
if (context.electronPlatformName !== "darwin") return;
const appName = context.packager.appInfo.productFilename;
const resourcesDir = path.join(context.appOutDir, `${appName}.app`, "Contents", "Resources");
fs.copyFileSync(
path.join(__dirname, "..", "icons", "Assets.car"),
path.join(resourcesDir, "Assets.car"),
);
};