Skip to content

Commit d55cafe

Browse files
committed
can use local icons
1 parent 866034d commit d55cafe

2 files changed

Lines changed: 19 additions & 2 deletions

File tree

bin/options/icon.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,15 @@ export async function handleIcon(
344344
return result || resolvedPath;
345345
}
346346

347+
// Check for existing local icon before downloading
348+
if (options.name) {
349+
const localIconPath = generateIconPath(options.name);
350+
if (await fsExtra.pathExists(localIconPath)) {
351+
logger.info(`✼ Using existing local icon: ${localIconPath}`);
352+
return localIconPath;
353+
}
354+
}
355+
347356
// Try favicon from website
348357
if (url && options.name) {
349358
const faviconPath = await tryGetFavicon(url, options.name);

dist/cli.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ var scripts = {
6868
prepublishOnly: "pnpm run cli:build"
6969
};
7070
var type = "module";
71-
var exports$1 = "./dist/cli.js";
71+
var exports = "./dist/cli.js";
7272
var license = "MIT";
7373
var dependencies = {
7474
"@tauri-apps/api": "^2.9.1",
@@ -126,7 +126,7 @@ var packageJson = {
126126
files: files,
127127
scripts: scripts,
128128
type: type,
129-
exports: exports$1,
129+
exports: exports,
130130
license: license,
131131
dependencies: dependencies,
132132
devDependencies: devDependencies,
@@ -1640,6 +1640,14 @@ async function handleIcon(options, url) {
16401640
const result = await processIcon(resolvedPath, options.name || '');
16411641
return result || resolvedPath;
16421642
}
1643+
// Check for existing local icon before downloading
1644+
if (options.name) {
1645+
const localIconPath = generateIconPath(options.name);
1646+
if (await fsExtra.pathExists(localIconPath)) {
1647+
logger.info(`✼ Using existing local icon: ${localIconPath}`);
1648+
return localIconPath;
1649+
}
1650+
}
16431651
// Try favicon from website
16441652
if (url && options.name) {
16451653
const faviconPath = await tryGetFavicon(url, options.name);

0 commit comments

Comments
 (0)