🔖 2.2.3

This commit is contained in:
Tw93
2023-07-21 21:33:07 +08:00
parent 26f2156e57
commit 95d44daa82
3 changed files with 10 additions and 6 deletions

5
bin/options/icon.ts vendored
View File

@@ -2,6 +2,7 @@ import path from 'path';
import axios from 'axios'; import axios from 'axios';
import fsExtra from 'fs-extra'; import fsExtra from 'fs-extra';
import chalk from 'chalk'; import chalk from 'chalk';
import { dir } from 'tmp-promise';
import logger from './logger'; import logger from './logger';
import { npmDirectory } from '@/utils/dir'; import { npmDirectory } from '@/utils/dir';
@@ -43,8 +44,8 @@ export async function downloadIcon(iconUrl: string) {
return null; return null;
} }
const iconPath = `assets/icon.${fileDetails.ext}`; const { path: tempPath } = await dir();
await fsExtra.outputFile(`./src-tauri/${iconPath}`, iconData); const iconPath = `${tempPath}/icon.${fileDetails.ext}`;
await fsExtra.outputFile(iconPath, iconData); await fsExtra.outputFile(iconPath, iconData);
spinner.succeed(chalk.green('Icon downloaded successfully!')); spinner.succeed(chalk.green('Icon downloaded successfully!'));
return iconPath; return iconPath;

8
dist/cli.js vendored
View File

@@ -13,13 +13,14 @@ import http from 'http';
import { promisify } from 'util'; import { promisify } from 'util';
import updateNotifier from 'update-notifier'; import updateNotifier from 'update-notifier';
import axios from 'axios'; import axios from 'axios';
import { dir } from 'tmp-promise';
import { fileTypeFromBuffer } from 'file-type'; import { fileTypeFromBuffer } from 'file-type';
import psl from 'psl'; import psl from 'psl';
import isUrl from 'is-url'; import isUrl from 'is-url';
import fs from 'fs'; import fs from 'fs';
var name = "pake-cli"; 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 description = "🤱🏻 Turn any webpage into a desktop app with Rust. 🤱🏻 很简单的用 Rust 打包网页生成很小的桌面 App。";
var engines = { var engines = {
node: ">=16.0.0" node: ">=16.0.0"
@@ -78,6 +79,7 @@ var dependencies = {
prompts: "^2.4.2", prompts: "^2.4.2",
psl: "^1.9.0", psl: "^1.9.0",
shelljs: "^0.8.5", shelljs: "^0.8.5",
"tmp-promise": "^3.0.3",
"update-notifier": "^6.0.2" "update-notifier": "^6.0.2"
}; };
var devDependencies = { var devDependencies = {
@@ -819,8 +821,8 @@ async function downloadIcon(iconUrl) {
if (!fileDetails) { if (!fileDetails) {
return null; return null;
} }
const iconPath = `assets/icon.${fileDetails.ext}`; const { path: tempPath } = await dir();
await fsExtra.outputFile(`./src-tauri/${iconPath}`, iconData); const iconPath = `${tempPath}/icon.${fileDetails.ext}`;
await fsExtra.outputFile(iconPath, iconData); await fsExtra.outputFile(iconPath, iconData);
spinner.succeed(chalk.green('Icon downloaded successfully!')); spinner.succeed(chalk.green('Icon downloaded successfully!'));
return iconPath; return iconPath;

View File

@@ -1,6 +1,6 @@
{ {
"name": "pake-cli", "name": "pake-cli",
"version": "2.2.2", "version": "2.2.3",
"description": "🤱🏻 Turn any webpage into a desktop app with Rust. 🤱🏻 很简单的用 Rust 打包网页生成很小的桌面 App。", "description": "🤱🏻 Turn any webpage into a desktop app with Rust. 🤱🏻 很简单的用 Rust 打包网页生成很小的桌面 App。",
"engines": { "engines": {
"node": ">=16.0.0" "node": ">=16.0.0"
@@ -59,6 +59,7 @@
"prompts": "^2.4.2", "prompts": "^2.4.2",
"psl": "^1.9.0", "psl": "^1.9.0",
"shelljs": "^0.8.5", "shelljs": "^0.8.5",
"tmp-promise": "^3.0.3",
"update-notifier": "^6.0.2" "update-notifier": "^6.0.2"
}, },
"devDependencies": { "devDependencies": {