fix script

This commit is contained in:
Harsh Shandilya 2024-03-31 21:56:49 +05:30
parent 8b8a84e70e
commit 9fcf30ea03
1 changed files with 10 additions and 3 deletions

View File

@ -1,6 +1,13 @@
#!/usr/bin/env bash
set -euxo pipefail
set -euo pipefail
fd -tf png$ static/uploads -x cwebp -lossless -mt {} -o {.}.webp
fd -tf png$ static/uploads -X rm -v
function convert_to_webp() {
local DIR
DIR="${1}"
fd -tf png$ "${DIR:?}" -x cwebp -lossless -mt {} -o '{.}.webp'
fd -tf png$ "${DIR:?}" -X rm -v
}
convert_to_webp static/uploads
convert_to_webp content/posts