Created
March 24, 2023 08:32
-
-
Save fatuk/b2f955c1550b5d352addd2b7a622a38d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
IDS=$(cat app/javascript/application/icons/icon-sprites.svg | awk 'match($0, /id="v2-icon-/) { print $2 }') | |
for ID in $IDS | |
do | |
IconName=$(echo $ID | awk '{print substr($0, 13, length($0)-13)}') | |
IconsInUse=$(grep -rnw 'app/javascript/react-app' -e 'name="$IconName"') | |
SearchCommand="grep -rnw 'app/javascript/react-app' -e 'name=\"$IconName\"\|icon=\"$IconName\"\|iconName=\"$IconName\"'" | |
SearchResult=$(eval $SearchCommand) | |
if [[ "$SearchResult" != *"name"* && "$SearchResult" != *"icon"* && "$SearchResult" != *"iconName"* ]] | |
then | |
echo "${IconName}" | |
fi | |
done | |
exit 0; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment