From 21ff3f3a65e192985ae35455020de80b0520eb14 Mon Sep 17 00:00:00 2001 From: Tw93 Date: Sat, 22 Jul 2023 01:15:54 +0800 Subject: [PATCH] :bookmark: 2.2.5 --- bin/options/icon.ts | 9 ++++++++- dist/cli.js | 12 ++++++++++-- package.json | 2 +- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/bin/options/icon.ts b/bin/options/icon.ts index 6ee54e6..55c8c23 100644 --- a/bin/options/icon.ts +++ b/bin/options/icon.ts @@ -45,7 +45,14 @@ export async function downloadIcon(iconUrl: string) { } const { path: tempPath } = await dir(); - const iconPath = `${tempPath}/icon.${fileDetails.ext}`; + let iconPath = `${tempPath}/icon.${fileDetails.ext}`; + // Fix this for linux + if (IS_LINUX) { + iconPath = 'png/linux_temp.png'; + await fsExtra.outputFile(`${npmDirectory}/src-tauri/${iconPath}`, iconData); + } else { + await fsExtra.outputFile(iconPath, iconData); + } await fsExtra.outputFile(iconPath, iconData); spinner.succeed(chalk.green('Icon downloaded successfully!')); return iconPath; diff --git a/dist/cli.js b/dist/cli.js index 2047c1f..ec36287 100644 --- a/dist/cli.js +++ b/dist/cli.js @@ -20,7 +20,7 @@ import isUrl from 'is-url'; import fs from 'fs'; var name = "pake-cli"; -var version = "2.2.4"; +var version = "2.2.5"; var description = "๐Ÿคฑ๐Ÿป Turn any webpage into a desktop app with Rust. ๐Ÿคฑ๐Ÿป ๅพˆ็ฎ€ๅ•็š„็”จ Rust ๆ‰“ๅŒ…็ฝ‘้กต็”Ÿๆˆๅพˆๅฐ็š„ๆกŒ้ข Appใ€‚"; var engines = { node: ">=16.0.0" @@ -822,7 +822,15 @@ async function downloadIcon(iconUrl) { return null; } const { path: tempPath } = await dir(); - const iconPath = `${tempPath}/icon.${fileDetails.ext}`; + let iconPath = `${tempPath}/icon.${fileDetails.ext}`; + // Fix this for linux + if (IS_LINUX) { + iconPath = 'png/linux_temp.png'; + await fsExtra.outputFile(`${npmDirectory}/src-tauri/${iconPath}`, iconData); + } + else { + await fsExtra.outputFile(iconPath, iconData); + } await fsExtra.outputFile(iconPath, iconData); spinner.succeed(chalk.green('Icon downloaded successfully!')); return iconPath; diff --git a/package.json b/package.json index b415dc7..eb6676c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pake-cli", - "version": "2.2.4", + "version": "2.2.5", "description": "๐Ÿคฑ๐Ÿป Turn any webpage into a desktop app with Rust. ๐Ÿคฑ๐Ÿป ๅพˆ็ฎ€ๅ•็š„็”จ Rust ๆ‰“ๅŒ…็ฝ‘้กต็”Ÿๆˆๅพˆๅฐ็š„ๆกŒ้ข Appใ€‚", "engines": { "node": ">=16.0.0"