From 210646f359dcb5043b7f1da0620a66105405c0a2 Mon Sep 17 00:00:00 2001 From: Tw93 Date: Thu, 21 Aug 2025 16:57:18 +0800 Subject: [PATCH] :bug: Fixed the issue of package icon under Windows --- CLAUDE.md | 5 +++++ bin/options/icon.ts | 5 +++-- bin/options/index.ts | 3 ++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index e7733f1..199b67d 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -84,6 +84,11 @@ npm run build:mac # macOS universal build - [ ] Test with weekly.tw93.fun URL - [ ] Verify remote icon functionality (https://gw.alipayobjects.com/os/k/fw/weekly.icns) +**Testing Notes:** + +- Do NOT use `PAKE_NO_CONFIG_OVERWRITE=1` - this environment variable is not implemented +- For testing, simply use: `node dist/cli.js https://example.com --name TestApp --debug` + ## Core Components ### CLI Tool (`bin/`) diff --git a/bin/options/icon.ts b/bin/options/icon.ts index 66d315c..6caa658 100644 --- a/bin/options/icon.ts +++ b/bin/options/icon.ts @@ -155,8 +155,9 @@ export async function handleIcon(options: PakeAppOptions, url?: string) { return defaultPngPath; } - // If nothing exists, let the error bubble up - throw new Error('No default icon found for Windows build'); + // If nothing exists, return empty string to let merge.ts handle default icon + logger.warn('✼ No default icon found, will use pake default.'); + return ''; } const iconPath = IS_LINUX diff --git a/bin/options/index.ts b/bin/options/index.ts index d77d810..a0e4ef1 100644 --- a/bin/options/index.ts +++ b/bin/options/index.ts @@ -62,7 +62,8 @@ export default async function handleOptions( identifier: getIdentifier(url), }; - appOptions.icon = await handleIcon(appOptions, url); + const iconPath = await handleIcon(appOptions, url); + appOptions.icon = iconPath || undefined; return appOptions; }