Skip to content

 This project is dedicated to collecting high-quality macOS software and organizing them systematically by different categories for easy search and use.

chore: optimized icon detection in build script (#1708)

Viraj60e298880ccd
diff --git a/build/ast.mjs b/build/ast.mjs
index d171d017..a503f309 100644
--- a/build/ast.mjs
+++ b/build/ast.mjs
@@ -35,21 +35,23 @@ const getSoftwareName = (obj, result = { title: '' }) => {
}
const getIconDetail = (data, url = '') => {
- if (data.type === 'imageReference' && data.identifier && /^(freeware\s+icon|oss\s+icon|app-store\s+icon|awesome-list\s+icon)/.test(data.identifier.toLocaleLowerCase())) {
- let type = ''
- if (/^(freeware\s+icon)/.test(data.identifier.toLocaleLowerCase())) {
- type = 'freeware'
- }
- if (/^(oss\s+icon)/.test(data.identifier.toLocaleLowerCase())) {
- type = 'oss'
- }
- if (/^(app-store\s+icon)/.test(data.identifier.toLocaleLowerCase())) {
- type = 'app-store'
- }
- if (/^(awesome-list\s+icon)/.test(data.identifier.toLocaleLowerCase())) {
- type = 'awesome-list'
- }
- return { type, url }
+ if (data.type === 'imageReference' && data.identifier) {
+ const identifier = data.identifier.toLocaleLowerCase()
+ if (/^(freeware\s+icon|oss\s+icon|app-store\s+icon|awesome-list\s+icon)/.test(identifier)) {
+ let type = ''
+ if (/^(freeware\s+icon)/.test(identifier)) {
+ type = 'freeware'
+ }
+ if (/^(oss\s+icon)/.test(identifier)) {
+ type = 'oss'
+ }
+ if (/^(app-store\s+icon)/.test(identifier)) {
+ type = 'app-store'
+ }
+ if (/^(awesome-list\s+icon)/.test(identifier)) {
+ type = 'awesome-list'
+ }
+ return { type, url }
}
return false
}