-
Notifications
You must be signed in to change notification settings - Fork 22
/
validate-assets.sh
executable file
·42 lines (34 loc) · 882 Bytes
/
validate-assets.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# validate that token images are present
jq '.img.png, .img.svg' ./tokens/*.json |
while read -r FILE; do
if [[ $FILE == null ]]; then
continue
fi
# remove leading repo root
FILE=${FILE#*\/main\/}
# removes trailing "
FILE=${FILE%\"}
echo "Checking $FILE"
# check if image exists
if [[ ! -f "./$FILE" ]]; then
echo "$FILE does not exist"
exit 1
fi
done
# validate that chain images are present
jq '.configurations[].img.png, .configurations[].img.svg' ./chainConfig/*.json |
while read -r FILE; do
if [[ $FILE == null ]]; then
continue
fi
# remove leading repo root
FILE=${FILE#*\/main\/}
# removes trailing "
FILE=${FILE%\"}
echo "Checking $FILE"
# check if image exists
if [[ ! -f "./$FILE" ]]; then
echo "$FILE does not exist"
exit 1
fi
done