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];