修复默认图标错误问题
This commit is contained in:
3
bin/builders/common.ts
vendored
3
bin/builders/common.ts
vendored
@@ -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];
|
||||
|
||||
5
dist/cli.js
vendored
5
dist/cli.js
vendored
@@ -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];
|
||||
|
||||
Reference in New Issue
Block a user