Skip to content

Commit

Permalink
i_all: Warn and fail on glyphname duplicates
Browse files Browse the repository at this point in the history
[why]
We need the glyphnames to be unique, or some glyphs will not be
accessible later (in the cheat sheet, css, glyphnames).

[note]
Also already remove one non-effective duplicate that is first an alias
and later a real glyph in i_seti.sh

Signed-off-by: Fini Jastrow <[email protected]>
  • Loading branch information
Finii committed Mar 17, 2024
1 parent 2fa4598 commit da502d2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
8 changes: 7 additions & 1 deletion bin/scripts/lib/i_all.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
# Nerd Fonts Version: 3.1.1
# Script Version 1.2.0
# Script Version 1.3.0

# Usually this is called without argument. If the first argument
# is 'include-old-material' the old material design icons will be
Expand All @@ -15,6 +15,12 @@ fi

for set in "${sets[@]}"; do
i="${base}/i_${set}.sh"
dups=$(grep ' i_' "$i" | sed 's/.* i_//;s/=.*//' | sort | uniq -D | wc -l)
if [ "$dups" -gt 0 ]; then
echo "Found duplicate glyph names in ${i}"
grep ' i_' "$i" | sed 's/.* i_//;s/=.*//' | sort | uniq -D
exit 1
fi
# shellcheck disable=SC1090 # We check the sources individually
test -f "$i" -a -r "$i" && source "$i"
done
Expand Down
3 changes: 1 addition & 2 deletions src/svgs/icons.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@
022 i_seti_gulp gulp.svg
023 i_seti_grunt grunt.svg
024 i_custom_default file_nf.svg
024 i_seti_default
024 i_seti_text
025 i_seti_folder folder.svg
026 i_seti_css css.svg
027 i_seti_config config.svg
Expand Down Expand Up @@ -114,6 +112,7 @@
082 i_seti_dart dart.svg
083 i_seti_db db.svg
084 i_seti_default default.svg
084 i_seti_text
085 i_seti_deprecation_cop deprecation-cop.svg
086 i_seti_docker docker.svg
087 i_seti_d d.svg
Expand Down

0 comments on commit da502d2

Please sign in to comment.