From f11b03d13c758752e3c9ab06efa64ba8def1ad72 Mon Sep 17 00:00:00 2001 From: Tlntin Date: Thu, 29 Dec 2022 11:45:35 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=BB=98=E8=AE=A4=E5=9B=BE?= =?UTF-8?q?=E6=A0=87=E9=94=99=E8=AF=AF=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/builders/common.ts | 3 +++ dist/cli.js | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/bin/builders/common.ts b/bin/builders/common.ts index 9dca3df..62ccf50 100644 --- a/bin/builders/common.ts +++ b/bin/builders/common.ts @@ -195,18 +195,21 @@ export async function mergeTauriConfig( } else { updateIconPath = false; logger.warn(`icon file in Windows must be 256 * 256 pix with .ico type, but you give ${customIconExt}`); + tauriConf.tauri.bundle.icon = ["png/icon_256.ico"]; } } if (process.platform === "linux") { if (customIconExt != ".png") { updateIconPath = false; logger.warn(`icon file in Linux must be 512 * 512 pix with .png type, but you give ${customIconExt}`); + tauriConf.tauri.bundle.icon = ["png/icon_512.png"]; } } if (process.platform === "darwin" && customIconExt !== ".icns") { updateIconPath = false; logger.warn(`icon file in MacOS must be .icns type, but you give ${customIconExt}`); + tauriConf.tauri.bundle.icon = ["icons/icon.icns"]; } if (updateIconPath) { tauriConf.tauri.bundle.icon = [options.icon]; diff --git a/dist/cli.js b/dist/cli.js index 97167b2..f48a112 100644 --- a/dist/cli.js +++ b/dist/cli.js @@ -1766,7 +1766,7 @@ function mergeTauriConfig(url, options, tauriConf) { tauriConf.tauri.bundle.identifier = identifier; // 删除映射关系 if (process.platform === "linux") { - delete tauriConf.tauri.bundle.deb.files; + tauriConf.tauri.bundle.deb.files = []; } // 处理应用图标 const exists = yield fs$1.stat(options.icon) @@ -1784,17 +1784,20 @@ function mergeTauriConfig(url, options, tauriConf) { else { updateIconPath = false; logger.warn(`icon file in Windows must be 256 * 256 pix with .ico type, but you give ${customIconExt}`); + tauriConf.tauri.bundle.icon = ["png/icon_256.ico"]; } } if (process.platform === "linux") { if (customIconExt != ".png") { updateIconPath = false; logger.warn(`icon file in Linux must be 512 * 512 pix with .png type, but you give ${customIconExt}`); + tauriConf.tauri.bundle.icon = ["png/icon_512.png"]; } } if (process.platform === "darwin" && customIconExt !== ".icns") { updateIconPath = false; logger.warn(`icon file in MacOS must be .icns type, but you give ${customIconExt}`); + tauriConf.tauri.bundle.icon = ["icons/icon.icns"]; } if (updateIconPath) { tauriConf.tauri.bundle.icon = [options.icon];