Skip to content

Commit

Permalink
🔖 2.2.3
Browse files Browse the repository at this point in the history
  • Loading branch information
tw93 committed Jul 21, 2023
1 parent 26f2156 commit 95d44da
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
5 changes: 3 additions & 2 deletions bin/options/icon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import path from 'path';
import axios from 'axios';
import fsExtra from 'fs-extra';
import chalk from 'chalk';
import { dir } from 'tmp-promise';

import logger from './logger';
import { npmDirectory } from '@/utils/dir';
Expand Down Expand Up @@ -43,8 +44,8 @@ export async function downloadIcon(iconUrl: string) {
return null;
}

const iconPath = `assets/icon.${fileDetails.ext}`;
await fsExtra.outputFile(`./src-tauri/${iconPath}`, iconData);
const { path: tempPath } = await dir();
const iconPath = `${tempPath}/icon.${fileDetails.ext}`;
await fsExtra.outputFile(iconPath, iconData);
spinner.succeed(chalk.green('Icon downloaded successfully!'));
return iconPath;
Expand Down
8 changes: 5 additions & 3 deletions dist/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,14 @@ import http from 'http';
import { promisify } from 'util';
import updateNotifier from 'update-notifier';
import axios from 'axios';
import { dir } from 'tmp-promise';
import { fileTypeFromBuffer } from 'file-type';
import psl from 'psl';
import isUrl from 'is-url';
import fs from 'fs';

var name = "pake-cli";
var version = "2.2.2";
var version = "2.2.3";
var description = "🤱🏻 Turn any webpage into a desktop app with Rust. 🤱🏻 很简单的用 Rust 打包网页生成很小的桌面 App。";
var engines = {
node: ">=16.0.0"
Expand Down Expand Up @@ -78,6 +79,7 @@ var dependencies = {
prompts: "^2.4.2",
psl: "^1.9.0",
shelljs: "^0.8.5",
"tmp-promise": "^3.0.3",
"update-notifier": "^6.0.2"
};
var devDependencies = {
Expand Down Expand Up @@ -819,8 +821,8 @@ async function downloadIcon(iconUrl) {
if (!fileDetails) {
return null;
}
const iconPath = `assets/icon.${fileDetails.ext}`;
await fsExtra.outputFile(`./src-tauri/${iconPath}`, iconData);
const { path: tempPath } = await dir();
const iconPath = `${tempPath}/icon.${fileDetails.ext}`;
await fsExtra.outputFile(iconPath, iconData);
spinner.succeed(chalk.green('Icon downloaded successfully!'));
return iconPath;
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pake-cli",
"version": "2.2.2",
"version": "2.2.3",
"description": "🤱🏻 Turn any webpage into a desktop app with Rust. 🤱🏻 很简单的用 Rust 打包网页生成很小的桌面 App。",
"engines": {
"node": ">=16.0.0"
Expand Down Expand Up @@ -59,6 +59,7 @@
"prompts": "^2.4.2",
"psl": "^1.9.0",
"shelljs": "^0.8.5",
"tmp-promise": "^3.0.3",
"update-notifier": "^6.0.2"
},
"devDependencies": {
Expand Down

0 comments on commit 95d44da

Please sign in to comment.