commit b7409e84f2719bd8384127426e2c488de24ad8f1
parent 69ab7cf661bcd096a7b00adea37cfdaa623b15e7
Author: hhvn <dev@hhvn.uk>
Date: Tue, 1 Jun 2021 22:26:33 +0100
.s/b/imgclean: add support for other filetypes
Diffstat:
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/.scripts/bin/imgclean b/.scripts/bin/imgclean
@@ -1,12 +1,14 @@
#!/bin/sh
+filexts="jpg|jpeg|png"
+
[ -z "$1" ] || [ ! -d "$1" ] || [ ! -z "$2" ] && {
printf "usage: %s <dir>\n" "$(basename $0)"
exit 2
}
export IFS=$(printf '\n\t')
-for f in $(find . -maxdepth 1 -type f -name "*.JPG")
+for f in $(find . -maxdepth 1 -type f | grep -Ei "\.($filexts)$")
do
[ "$(uname)" = "OpenBSD" ] && summer=sha256
[ -z "$summer" ] && summer=sha256sum