now only considers staged files

Signed-off-by: Victor Seiji Hariki <victorseijih@gmail.com>
This commit is contained in:
Victor Seiji Hariki 2022-12-30 07:44:10 -03:00
parent 1fbde7ed69
commit c4d52fdfad
4 changed files with 9 additions and 5 deletions

9
.devtools/updatehashes.sh Normal file → Executable file
View file

@ -98,7 +98,14 @@ for htmlfile in $(find -type f -name \*.html -not -path "./node_modules/*")
do do
echo -e "${BIBlue}[info] Processing '${htmlfile}' for cache busting...${Color_Off}" echo -e "${BIBlue}[info] Processing '${htmlfile}' for cache busting...${Color_Off}"
for resourcefile in $(find -type f -regex '.*\.css\|.*\.js' -not -path "./node_modules/*" | sed 's/\.\///g') LIST=$(find -type f -regex '.*\.css\|.*\.js' -not -path "./node_modules/*" | sed 's/\.\///g')
if [ "$1" = "gitadd" ]
then
LIST=$(git status -s | grep -oE "[A-Z] .+" | cut -d" " -f3)
fi
for resourcefile in $LIST
do do
# Check if resource is used in html file # Check if resource is used in html file
resourceusage=$(grep -i "$resourcefile" "$htmlfile") resourceusage=$(grep -i "$resourcefile" "$htmlfile")

View file

@ -3,7 +3,7 @@
# Script to perform some basic operations to the code before committing. # Script to perform some basic operations to the code before committing.
# Adds file hashes to html script imports for cache busting purposes # Adds file hashes to html script imports for cache busting purposes
sh .devtools/updatehashes.sh sh .devtools/updatehashes.sh gitadd
# Adds file to current commit # Adds file to current commit
git add "**.html" git add "**.html"

View file

@ -1,3 +0,0 @@
/**
* This is a simple implementation of layer interaction
*/

View file