mirror of
https://github.com/Vencord/Vesktop.git
synced 2026-11-30 05:42:41 -08:00
changes the app icon and tray Co-authored-by: Wing <[email protected]> Co-authored-by: khcrysalis <[email protected]> Co-authored-by: Vendicated <[email protected]>
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`);
|
|
}
|