🐛 Fix the problem of Linux retrieving remote images
This commit is contained in:
5
bin/options/icon.ts
vendored
5
bin/options/icon.ts
vendored
@@ -2,7 +2,6 @@ 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';
|
||||
@@ -44,8 +43,8 @@ export async function downloadIcon(iconUrl: string) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const { path: tempPath } = await dir();
|
||||
const iconPath = `${tempPath}/icon.${fileDetails.ext}`;
|
||||
const iconPath = `assets/icon.${fileDetails.ext}`;
|
||||
await fsExtra.outputFile(`./src-tauri/${iconPath}`, iconData);
|
||||
await fsExtra.outputFile(iconPath, iconData);
|
||||
spinner.succeed(chalk.green('Icon downloaded successfully!'));
|
||||
return iconPath;
|
||||
|
||||
Reference in New Issue
Block a user