From da502d23a2a179ff1969a2e26810fced6175c1c8 Mon Sep 17 00:00:00 2001 From: Fini Jastrow Date: Sun, 17 Mar 2024 15:11:19 +0100 Subject: [PATCH] i_all: Warn and fail on glyphname duplicates [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 --- bin/scripts/lib/i_all.sh | 8 +++++++- src/svgs/icons.tsv | 3 +-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/bin/scripts/lib/i_all.sh b/bin/scripts/lib/i_all.sh index 953be47d1e..20650cf6ab 100644 --- a/bin/scripts/lib/i_all.sh +++ b/bin/scripts/lib/i_all.sh @@ -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 @@ -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 diff --git a/src/svgs/icons.tsv b/src/svgs/icons.tsv index b5f3b502f3..f76844810c 100644 --- a/src/svgs/icons.tsv +++ b/src/svgs/icons.tsv @@ -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 @@ -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