-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Realizar limpeza de ícones não utilizados
- Loading branch information
Showing
3 changed files
with
27 additions
and
0 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/usr/bin/env bash | ||
## Remove os ícones que não são usados no projeto, para diminuir o download realizado pelo Service Worker | ||
|
||
pushd "$(dirname ${BASH_SOURCE:0})" || exit 1 | ||
trap popd EXIT | ||
shopt -s globstar nullglob | ||
|
||
BASE_DIR="dist/browser/assets/mdi" | ||
|
||
if [ ! -d "$BASE_DIR" ]; then | ||
echo "Error: $BASE_DIR does not exist" | ||
exit 1 | ||
fi | ||
|
||
for i in "$BASE_DIR"/*.svg; do | ||
ICON_NAME=$(basename "$i") | ||
|
||
# Check if any file inside src/ uses the icon | ||
if grep -q "$ICON_NAME" src/**/*.ts src/**/*.html src/**/*.scss; then | ||
echo "skipped $ICON_NAME" | ||
continue | ||
fi | ||
|
||
rm "$i" | ||
done |