about summary refs log tree commit diff stats
path: root/build/rust/scripts
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2024-12-01 12:42:55 +0100
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2024-12-01 12:42:55 +0100
commit1519f60dd0d6b2352c692f1edeedc29c533b752e (patch)
tree9977d179f25d295269bb1f3e149ee94e619febf3 /build/rust/scripts
parentfix(templates/latex/presentation/flake.nix): Remove outdated follow (diff)
downloadflake-templates-1519f60dd0d6b2352c692f1edeedc29c533b752e.tar.gz
flake-templates-1519f60dd0d6b2352c692f1edeedc29c533b752e.zip
chore(build): Re-generate
Diffstat (limited to '')
-rwxr-xr-xbuild/rust/scripts/optimize_images.sh5
1 files changed, 3 insertions, 2 deletions
diff --git a/build/rust/scripts/optimize_images.sh b/build/rust/scripts/optimize_images.sh
index 0f48e4b..444405d 100755
--- a/build/rust/scripts/optimize_images.sh
+++ b/build/rust/scripts/optimize_images.sh
@@ -25,7 +25,8 @@ find_files_by_extension() {
     tmp="$(mktemp)"
 
     git ls-files --cached --modified --other --exclude-standard --deduplicate | while IFS= read -r file; do
-        extension="${file#*.}"
+        file_basename="$(basename "$file")"
+        extension="${file_basename#*.}"
         if [ "$extension" = "$wanted_extension" ]; then
             echo "$file"
         else
@@ -90,7 +91,7 @@ optimize_files() {
     TOTAL_SAVED_INNER=0
 
     while IFS= read -r f; do
-        printf "%-2s/${COUNT} $f ... " "$I"
+        printf "%s/${COUNT} $f ... " "$I"
 
         SIZE="$(size_of "$f")"