changes the app icon and tray Co-authored-by: Wing <44992537+wingio@users.noreply.github.com> Co-authored-by: khcrysalis <sam4r16@gmail.com> Co-authored-by: Vendicated <vendicated@riseup.net>
25 lines
719 B
JavaScript
25 lines
719 B
JavaScript
import { copyFile, readdir } from "fs/promises";
|
|
|
|
/**
|
|
* @param {{
|
|
* readonly appOutDir: string;
|
|
* readonly arch: Arch;
|
|
* readonly electronPlatformName: string;
|
|
* readonly outDir: string;
|
|
* readonly packager: PlatformPackager;
|
|
* readonly targets: Target[];
|
|
* }} context
|
|
*/
|
|
export async function addAssetsCar({ appOutDir }) {
|
|
if (process.platform !== "darwin") return;
|
|
|
|
const appName = (await readdir(appOutDir)).find(item => item.endsWith(".app"));
|
|
|
|
if (!appName) {
|
|
console.warn(`Could not find .app directory in ${appOutDir}. Skipping adding assets.car`);
|
|
return;
|
|
}
|
|
|
|
await copyFile("build/Assets.car", `${appOutDir}/${appName}/Contents/Resources/Assets.car`);
|
|
}
|