diff options
author | Jan Huwald <jh@sotun.de> | 2014-11-05 14:43:18 (GMT) |
---|---|---|
committer | Jan Huwald <jh@sotun.de> | 2014-11-05 14:43:18 (GMT) |
commit | 969660650110484c1aced8642778d11b03bd169c (patch) | |
tree | 88643ef8e34d661547f4621f474e5af65fd64f3d | |
parent | ec7e185f679cc48fd6ded8cec1f253bc19782150 (diff) |
terminate if destination file already exists
Otherwise user might inadvertadly use the wrong file if he does not
notice the error message.
-rwxr-xr-x | anondcim | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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") |