File tree 2 files changed +50
-1
lines changed
2 files changed +50
-1
lines changed Original file line number Diff line number Diff line change @@ -410,9 +410,14 @@ else
410
410
endif
411
411
.PHONY : fmt/shfmt
412
412
413
- lint : lint/shellcheck lint/go lint/ts lint/helm
413
+ lint : lint/shellcheck lint/go lint/ts lint/helm lint/site-icons
414
414
.PHONY : lint
415
415
416
+ lint/site-icons :
417
+ ./scripts/check_site_icons.sh
418
+
419
+ .PHONY : lint/site-icons
420
+
416
421
lint/ts :
417
422
cd site
418
423
yarn && yarn lint
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ set -euo pipefail
4
+ # shellcheck source=scripts/lib.sh
5
+ source " $( dirname " ${BASH_SOURCE[0]} " ) /lib.sh"
6
+ cdroot
7
+
8
+ cd site/static/icon
9
+
10
+ # These exceptions are here for backwards compatibility. All new icons should
11
+ # be SVG to minimize the size of our repo and our bundle.
12
+ exceptions=(
13
+ " aws.png"
14
+ " azure.png"
15
+ " docker.png"
16
+ " do.png"
17
+ " gcp.png"
18
+ " k8s.png"
19
+ )
20
+
21
+ function is_exception() {
22
+ local value=" $1 "
23
+ shift
24
+ for item; do
25
+ [[ " $item " == " $value " ]] && return 0
26
+ done
27
+ return 1
28
+ }
29
+
30
+ for file in * ; do
31
+ # Extract filename
32
+ filename=$( basename -- " $file " )
33
+
34
+ # Check if the file is in the exception list
35
+ if is_exception " $filename " " ${exceptions[@]} " ; then
36
+ continue
37
+ fi
38
+
39
+ # If not an exception, check if it's an svg file
40
+ if [[ " $file " != * .svg ]]; then
41
+ echo " Found a non-svg file not in exception list: $file "
42
+ exit 1
43
+ fi
44
+ done
You can’t perform that action at this time.
0 commit comments