updates
[dotfiles.git] / x / .local / bin / thumbnailer.sh
index 0867ee9..9c7edeb 100755 (executable)
@@ -15,6 +15,7 @@ fi
 log "Processing $1 to $2"
 
 TMPDIR="$(mktemp -d)"
+trap "rm -r $TMPDIR" EXIT 
 log "Temp directory created in $TMPDIR"
 
 NUMPAGES=$(identify "$1" | wc -l)
@@ -30,8 +31,3 @@ log "done!"
 
 montage -geometry +0+0 $TMPDIR/*.png "$2"
 log "Montaging done"
-
-rm -r $TMPDIR
-log "Cleaned up"
-
-log "Done"