mirror of
https://github.com/Pandipipas/scoreko-electron-dev.git
synced 2026-06-06 05:32:06 +00:00
test(main): completar fase 2 con cobertura de iconos y timing
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
import fs from "node:fs";
|
||||
import path from "node:path";
|
||||
|
||||
import { AppRuntimeConfig } from "../config/runtime-config";
|
||||
|
||||
export function resolveAppIconPath(
|
||||
runtimeConfig: AppRuntimeConfig,
|
||||
rootPath: string,
|
||||
pathExists: (candidatePath: string) => boolean = fs.existsSync,
|
||||
): string | undefined {
|
||||
const iconCandidates = [
|
||||
runtimeConfig.iconPathOverride,
|
||||
path.join(rootPath, "static", "icons", "icon.ico"),
|
||||
path.join(rootPath, "static", "icons", "icon.png"),
|
||||
path.join(rootPath, "static", "icon.ico"),
|
||||
path.join(rootPath, "static", "icon.png"),
|
||||
].filter((candidate): candidate is string => Boolean(candidate));
|
||||
|
||||
return iconCandidates.find((candidate) => pathExists(candidate));
|
||||
}
|
||||
Reference in New Issue
Block a user