pakstr 0.18.0 → 0.18.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -38,18 +38,18 @@ async function resolveAppIcon(input) {
|
|
|
38
38
|
}
|
|
39
39
|
if (input.configuredIcon !== undefined) {
|
|
40
40
|
const configured = (0, assetPath_1.resolveAssetPath)(input.configuredIcon, configDir);
|
|
41
|
-
if (!fs_1.default.existsSync(configured) || !fs_1.default.lstatSync(configured).isFile()) {
|
|
42
|
-
throw new Error(`❌ Icon not found or not a regular file: ${configured}`);
|
|
43
|
-
}
|
|
44
41
|
try {
|
|
42
|
+
if (!fs_1.default.existsSync(configured) || !fs_1.default.lstatSync(configured).isFile()) {
|
|
43
|
+
throw new Error("not found or not a regular file");
|
|
44
|
+
}
|
|
45
45
|
const metadata = await (0, sharp_1.default)(configured).metadata();
|
|
46
46
|
if (!metadata.width || !metadata.height)
|
|
47
47
|
throw new Error("image has no dimensions");
|
|
48
|
+
return { path: configured, source: "configured" };
|
|
48
49
|
}
|
|
49
50
|
catch (error) {
|
|
50
|
-
|
|
51
|
+
console.warn(`⚠️ Ignoring unsuitable configured icon ${configured}: ${error instanceof Error ? error.message : String(error)}`);
|
|
51
52
|
}
|
|
52
|
-
return { path: configured, source: "configured" };
|
|
53
53
|
}
|
|
54
54
|
return { path: input.defaultIcon, source: "default" };
|
|
55
55
|
}
|