electrobun 0.13.0-beta.1 → 0.13.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/cli/index.ts +22 -5
package/package.json
CHANGED
package/src/cli/index.ts
CHANGED
|
@@ -1093,11 +1093,28 @@ if (commandArg === "init") {
|
|
|
1093
1093
|
|
|
1094
1094
|
const buildIcons = (appBundleFolderResourcesPath: string) => {
|
|
1095
1095
|
// Platform-specific icon handling
|
|
1096
|
-
if (targetOS === 'macos' && config.build.mac?.
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1096
|
+
if (targetOS === 'macos' && config.build.mac?.icons) {
|
|
1097
|
+
// macOS uses .iconset folders that get converted to .icns using iconutil
|
|
1098
|
+
// This only works when building on macOS since iconutil is a macOS-only tool
|
|
1099
|
+
const iconSourceFolder = join(projectRoot, config.build.mac.icons);
|
|
1100
|
+
const iconDestPath = join(appBundleFolderResourcesPath, "AppIcon.icns");
|
|
1101
|
+
if (existsSync(iconSourceFolder)) {
|
|
1102
|
+
if (OS === 'macos') {
|
|
1103
|
+
// Use iconutil to convert .iconset folder to .icns
|
|
1104
|
+
Bun.spawnSync(
|
|
1105
|
+
["iconutil", "-c", "icns", "-o", iconDestPath, iconSourceFolder],
|
|
1106
|
+
{
|
|
1107
|
+
cwd: appBundleFolderResourcesPath,
|
|
1108
|
+
stdio: ["ignore", "inherit", "inherit"],
|
|
1109
|
+
env: {
|
|
1110
|
+
...process.env,
|
|
1111
|
+
ELECTROBUN_BUILD_ENV: buildEnvironment,
|
|
1112
|
+
},
|
|
1113
|
+
}
|
|
1114
|
+
);
|
|
1115
|
+
} else {
|
|
1116
|
+
console.log(`WARNING: Cannot build macOS icons on ${OS} - iconutil is only available on macOS`);
|
|
1117
|
+
}
|
|
1101
1118
|
}
|
|
1102
1119
|
} else if (targetOS === 'linux' && config.build.linux?.icon) {
|
|
1103
1120
|
const iconSourcePath = join(projectRoot, config.build.linux.icon);
|