git.lucas.co / fontpreview
git clone https://git.lucas.co/fontpreview.git

commitab909d76b9e3bbd27cd4d1fb6af8fd092014db3a
parent8fc1aa1454
authorBirnthaler Martin <[email protected]>
date2020-02-09 15:14
Remove tempfiles before exiting

 fontpreview | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/fontpreview b/fontpreview
index eafbf38..5f9b35a 100755
--- a/fontpreview
+++ b/fontpreview
@@ -50,7 +50,9 @@ pre_exit() {
     # exit this script, an error will be shown
     # from kill and we dont want that
     kill -9 "$(cat "$PIDFILE" 2>/dev/null)" &> /dev/null
- 
+
+    # Delete tempfiles, so we don't leave useless files behind.
+    rm -rf "$FONTPREVIEW_DIR"
 }
 
 generate_preview(){