Skip to content

Commit e4ec675

Browse files
Adapt check_icons to Apex
1 parent a58498c commit e4ec675

File tree

1 file changed

+18
-8
lines changed

1 file changed

+18
-8
lines changed

scripts/check_icons.sh

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,23 @@ set -e
55
# shellcheck source=scripts/logger.sh
66
source "$(dirname "$0")/logger.sh"
77

8+
89
check_geometry() (
910
error=0
1011
file="$1"
1112
device="$2"
1213

1314
case "$device" in
14-
"nanos")
15+
nanos)
1516
geometry="16x16"
1617
;;
17-
"nanox")
18-
geometry="14x14"
19-
;;
20-
"nanos2")
18+
nanox | nanos2)
2119
geometry="14x14"
2220
;;
23-
"stax")
21+
stax | apex | apex_m | apex_p)
2422
geometry="32x32"
2523
;;
26-
"flex")
24+
flex)
2725
geometry="40x40"
2826
;;
2927
*)
@@ -202,14 +200,26 @@ main() (
202200
for icon_and_device in "${!icons_and_devices[@]}"; do
203201
icon="$(echo "$icon_and_device" | cut -d';' -f1)"
204202
device="$(echo "$icon_and_device" | cut -d';' -f2)"
205-
check_icon "$repo_name" "$device" "$repo/$build_directory/$icon" || error=1
203+
img_file="$repo/$build_directory/$icon"
204+
if ! [[ -f "$img_file" ]]; then
205+
log_error "Icon file '$img_file' Doesn't exist!"
206+
error=1
207+
continue
208+
fi
209+
check_icon "$repo_name" "$device" "$img_file" || error=1
206210
done
207211

208212
# As we scanned for all devices and all variants, we can have a lot of duplicates for glyphs. Filter out duplicates and empty lines
209213
all_glyph_files_no_duplicates="$(echo "$all_glyph_files" | tr ' ' '\n' | sort -u | grep .)"
210214
while IFS= read -r file; do
211215
# Skip SDK glyphs
212216
if [[ "$file" != "/opt/"*"-secure-sdk/"* ]]; then
217+
img_file="$repo/$build_directory/$file"
218+
if ! [[ -f "$img_file" ]]; then
219+
log_error "Glyph file '$img_file' Doesn't exist!"
220+
error=1
221+
continue
222+
fi
213223
check_glyph "$repo/$build_directory/$file" || error=1
214224
fi
215225
done < <(echo "$all_glyph_files_no_duplicates")

0 commit comments

Comments
 (0)