Skip to content

Commit

Permalink
Clean temporary directory when canceled
Browse files Browse the repository at this point in the history
  • Loading branch information
amarakon authored Sep 2, 2022
1 parent 837014e commit bcb98c8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion dman
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
#!/bin/sh

progname=$(basename $0)

directory=/tmp/$progname

cleanup() { rm -rf $directory; }
trap cleanup EXIT
trap exit INT HUP TERM

[ ! -d "$directory" ] && mkdir $directory
title="$(apropos . | dmenu -l 10 | cut -d " " -f 1-2 | tr -d " ")"
Expand Down

0 comments on commit bcb98c8

Please sign in to comment.