From bd6078d288720c6df6ecaa79c04b31db9ce5fba8 Mon Sep 17 00:00:00 2001 From: Tlntin Date: Sat, 18 Mar 2023 13:58:18 +0800 Subject: [PATCH] update pake-cli to 1.3.0 --- bin/builders/common.ts | 17 ++++++++++++++++- dist/cli.js | 19 +++++++++++++++++-- package.json | 2 +- 3 files changed, 34 insertions(+), 4 deletions(-) diff --git a/bin/builders/common.ts b/bin/builders/common.ts index 88bf1ca..870a53c 100644 --- a/bin/builders/common.ts +++ b/bin/builders/common.ts @@ -64,6 +64,7 @@ export async function mergeTauriConfig( .then(() => true) .catch(() => false); if (process.platform === "linux") { + delete tauriConf.tauri.bundle.deb.files; if (["all", "deb", "appimage"].includes(options.targets)) { tauriConf.tauri.bundle.targets = [options.targets]; } else { @@ -85,7 +86,6 @@ export async function mergeTauriConfig( } } if (process.platform === "linux") { - 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}`); @@ -103,6 +103,21 @@ export async function mergeTauriConfig( } } else { logger.warn("the custom icon path may not exists. we will use default icon to replace it"); + switch (process.platform) { + case "win32": { + tauriConf.tauri.bundle.resources = ['png/icon_32.ico']; + tauriConf.tauri.bundle.icon = ['png/icon_32.ico', 'png/icon_256.ico'] + break; + } + case "darwin": { + tauriConf.tauri.bundle.icon = ['icons/icon.icns'] + break; + } + case "linux": { + tauriConf.tauri.bundle.icon = ['png/icon_512.png'] + break; + } + } } diff --git a/dist/cli.js b/dist/cli.js index 72ad381..2613499 100644 --- a/dist/cli.js +++ b/dist/cli.js @@ -1659,6 +1659,7 @@ function mergeTauriConfig(url, options, tauriConf) { .then(() => true) .catch(() => false); if (process.platform === "linux") { + delete tauriConf.tauri.bundle.deb.files; if (["all", "deb", "appimage"].includes(options.targets)) { tauriConf.tauri.bundle.targets = [options.targets]; } @@ -1681,7 +1682,6 @@ function mergeTauriConfig(url, options, tauriConf) { } } if (process.platform === "linux") { - 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}`); @@ -1700,6 +1700,21 @@ function mergeTauriConfig(url, options, tauriConf) { } else { logger.warn("the custom icon path may not exists. we will use default icon to replace it"); + switch (process.platform) { + case "win32": { + tauriConf.tauri.bundle.resources = ['png/icon_32.ico']; + tauriConf.tauri.bundle.icon = ['png/icon_32.ico', 'png/icon_256.ico']; + break; + } + case "darwin": { + tauriConf.tauri.bundle.icon = ['icons/icon.icns']; + break; + } + case "linux": { + tauriConf.tauri.bundle.icon = ['png/icon_512.png']; + break; + } + } } let configPath = ""; switch (process.platform) { @@ -2183,7 +2198,7 @@ class BuilderFactory { } var name = "pake-cli"; -var version = "1.2.9"; +var version = "1.3.0"; var description = "๐Ÿคฑ๐Ÿป Turn any webpage into a desktop app with Rust. ๐Ÿคฑ๐Ÿป ๅพˆ็ฎ€ๅ•็š„็”จ Rust ๆ‰“ๅŒ…็ฝ‘้กต็”Ÿๆˆๅพˆๅฐ็š„ๆกŒ้ข Appใ€‚"; var engines = { node: ">=16.0.0" diff --git a/package.json b/package.json index f7613dc..aaf5aae 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pake-cli", - "version": "1.2.9", + "version": "1.3.0", "description": "๐Ÿคฑ๐Ÿป Turn any webpage into a desktop app with Rust. ๐Ÿคฑ๐Ÿป ๅพˆ็ฎ€ๅ•็š„็”จ Rust ๆ‰“ๅŒ…็ฝ‘้กต็”Ÿๆˆๅพˆๅฐ็š„ๆกŒ้ข Appใ€‚", "engines": { "node": ">=16.0.0"