ffsvg.sh: create temp file to avoid overwriting a file with 0 bytes

This commit is contained in:
Sergei Eremenko 2020-01-07 14:56:39 +02:00
parent a130a9c450
commit 4d58875852

View file

@ -26,7 +26,8 @@ _run_helpers() {
# optimize a SVG # optimize a SVG
if command -v svgo > /dev/null 2>&1; then if command -v svgo > /dev/null 2>&1; then
# use SVGO # use SVGO
svgo --config="$SCRIPT_DIR/_svgo.yml" -i "$1" svgo --config="$SCRIPT_DIR/_svgo.yml" -i "$1" -o "$1".tmp
mv -f "$1".tmp "$1"
elif command -v scour > /dev/null 2>&1; then elif command -v scour > /dev/null 2>&1; then
# use scour # use scour
"$SCRIPT_DIR/_scour.sh" "$1" "$SCRIPT_DIR/_scour.sh" "$1"