From 4d58875852a293b74f44495b892882afda9542bb Mon Sep 17 00:00:00 2001 From: Sergei Eremenko Date: Tue, 7 Jan 2020 14:56:39 +0200 Subject: [PATCH] ffsvg.sh: create temp file to avoid overwriting a file with 0 bytes --- tools/ffsvg.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/ffsvg.sh b/tools/ffsvg.sh index 96f52fe59a..a299fd9260 100755 --- a/tools/ffsvg.sh +++ b/tools/ffsvg.sh @@ -26,7 +26,8 @@ _run_helpers() { # optimize a SVG if command -v svgo > /dev/null 2>&1; then # 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 # use scour "$SCRIPT_DIR/_scour.sh" "$1"