now only considers staged files
Signed-off-by: Victor Seiji Hariki <victorseijih@gmail.com>
This commit is contained in:
parent
1fbde7ed69
commit
c4d52fdfad
4 changed files with 9 additions and 5 deletions
9
.devtools/updatehashes.sh
Normal file → Executable file
9
.devtools/updatehashes.sh
Normal file → Executable file
|
@ -98,7 +98,14 @@ for htmlfile in $(find -type f -name \*.html -not -path "./node_modules/*")
|
|||
do
|
||||
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
|
||||
# Check if resource is used in html file
|
||||
resourceusage=$(grep -i "$resourcefile" "$htmlfile")
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
# Script to perform some basic operations to the code before committing.
|
||||
|
||||
# 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
|
||||
git add "**.html"
|
|
@ -1,3 +0,0 @@
|
|||
/**
|
||||
* This is a simple implementation of layer interaction
|
||||
*/
|
Loading…
Reference in a new issue