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

commit0c297e5d2f340334448d98538f42dc8f25521a04
parentf4300064a3
authormaxdevjs <max.devjs@gmail.com>
date2020-02-08 18:19
Create temp directory

to contain fontopreview temp files.

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

diff --git a/fontpreview b/fontpreview
index 3b3442b..ed4e373 100755
--- a/fontpreview
+++ b/fontpreview
@@ -6,9 +6,10 @@
 
 # Use mktemp to create temporary files that won't
 # collide with any other application's tmp files.
-PIDFILE="$(mktemp --tmpdir fontpreview_XXXXXXXX.pid)"
-FONT_PREVIEW="$(mktemp --tmpdir fontpreview_XXXXXXXX.png)"
-TERMWIN_IDFILE="$(mktemp --tmpdir fontpreview_XXXXXXXX.termpid)"
+FONTPREVIEW_DIR="$(mktemp -d --tmpdir fontpreview_dir_XXXXXXXX)"
+PIDFILE="$(mktemp --tmpdir="$FONTPREVIEW_DIR" fontpreview_XXXXXXXX.pid)"
+FONT_PREVIEW="$(mktemp --tmpdir="$FONTPREVIEW_DIR" fontpreview_XXXXXXXX.png)"
+TERMWIN_IDFILE="$(mktemp --tmpdir="$FONTPREVIEW_DIR" fontpreview_XXXXXXXX.termpid)"
 VERSION=1.0.0
 
 # Default values