From 5c50574502b097f6f5a60ec3f0588e1871270ae5 Mon Sep 17 00:00:00 2001 From: Roger Gonzalez Date: Tue, 10 Jan 2023 14:45:33 -0300 Subject: Added pre-commit and ignored .png files in gitignore --- pre-commit | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100755 pre-commit (limited to 'pre-commit') diff --git a/pre-commit b/pre-commit new file mode 100755 index 0000000..b2a2042 --- /dev/null +++ b/pre-commit @@ -0,0 +1,6 @@ +#!/bin/sh +# +set -eo pipefail + +find ./ -type f -name '*.png' -not -path '*/.git/*' -exec sh -c 'cwebp $1 -o "${1%.png}.webp"' _ {} \; +find . -type f -not -path '*/.git/*' -exec sed -i -e 's/\.png/\.webp/g' {} \; -- cgit v1.2.3