From c4d52fdfad6ccfdb56e3e715af22f4447f19652b Mon Sep 17 00:00:00 2001 From: Victor Seiji Hariki Date: Fri, 30 Dec 2022 07:44:10 -0300 Subject: [PATCH] now only considers staged files Signed-off-by: Victor Seiji Hariki --- .devtools/updatehashes.sh | 9 ++++++++- .githooks/pre-commit | 2 +- js/ui/explore.js | 3 --- js/ui/tool/populate.js | 0 4 files changed, 9 insertions(+), 5 deletions(-) mode change 100644 => 100755 .devtools/updatehashes.sh delete mode 100644 js/ui/explore.js delete mode 100644 js/ui/tool/populate.js diff --git a/.devtools/updatehashes.sh b/.devtools/updatehashes.sh old mode 100644 new mode 100755 index d62cab5..e52c675 --- a/.devtools/updatehashes.sh +++ b/.devtools/updatehashes.sh @@ -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") diff --git a/.githooks/pre-commit b/.githooks/pre-commit index e0a6f7a..3bfde07 100755 --- a/.githooks/pre-commit +++ b/.githooks/pre-commit @@ -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" \ No newline at end of file diff --git a/js/ui/explore.js b/js/ui/explore.js deleted file mode 100644 index 212a275..0000000 --- a/js/ui/explore.js +++ /dev/null @@ -1,3 +0,0 @@ -/** - * This is a simple implementation of layer interaction - */ diff --git a/js/ui/tool/populate.js b/js/ui/tool/populate.js deleted file mode 100644 index e69de29..0000000