修复pake-cli当用户输入图标格式错误引起无法安装问题
This commit is contained in:
15
bin/builders/common.ts
vendored
15
bin/builders/common.ts
vendored
@@ -58,25 +58,16 @@ export async function mergeTauriConfig(
|
||||
}
|
||||
}
|
||||
if (process.platform === "linux") {
|
||||
tauriConf.package.productName = name.toLowerCase();
|
||||
if (customIconExt === ".png") {
|
||||
const installSrc = `/usr/share/applications/${name.toLowerCase()}.desktop`;
|
||||
const assertSrc = `src-tauri/assets/${name.toLowerCase()}.desktop`;
|
||||
const assertPath = path.join(npmDirectory, assertSrc);
|
||||
tauriConf.tauri.bundle.deb.files = {
|
||||
[installSrc]: assertPath
|
||||
}
|
||||
} else {
|
||||
delete tauriConf.tauri.bundle.deb.files;
|
||||
if (customIconExt != ".png") {
|
||||
updateIconPath = false;
|
||||
logger.warn(`icon file in Linux must be 512 * 512 pix with .png type, but you give ${customIconExt}`);
|
||||
}
|
||||
}
|
||||
|
||||
if (process.platform === "darwin") {
|
||||
if (customIconExt !== ".icns") {
|
||||
if (process.platform === "darwin" && customIconExt !== ".icns") {
|
||||
updateIconPath = false;
|
||||
logger.warn(`icon file in MacOS must be .icns type, but you give ${customIconExt}`);
|
||||
}
|
||||
}
|
||||
if (updateIconPath) {
|
||||
tauriConf.tauri.bundle.icon = [options.icon];
|
||||
|
||||
Reference in New Issue
Block a user