From 969660650110484c1aced8642778d11b03bd169c Mon Sep 17 00:00:00 2001 From: Jan Huwald Date: Wed, 5 Nov 2014 15:43:18 +0100 Subject: terminate if destination file already exists Otherwise user might inadvertadly use the wrong file if he does not notice the error message. diff --git a/anondcim b/anondcim index d3f2483..df5d4b9 100755 --- a/anondcim +++ b/anondcim @@ -63,7 +63,7 @@ do # always use a padded number as destination filename suffix dst="$dst$file_prefix$(echo -n "0000000000$cur" | tail -c ${#total}).jpg" echo "anonymizing \"$fn\" to \"$dst\" ($cur/$total)" - [ -e "$dst" ] && { err "destination \"$dst\" for source \"$fn\" already exists, anonymization is skipped"; continue; } + [ ! -e "$dst" ] || die "destination \"$dst\" for source \"$fn\" already exists" read w h << EOF $(identify -format '%w %h' "$fn") -- cgit v0.10.1