From 828ce9c6400f3dddb6189bec6da7f2fd173af10b Mon Sep 17 00:00:00 2001 From: Orestis Floros Date: Wed, 27 Sep 2017 15:23:32 +0300 Subject: [PATCH] dump-asy.pl: use correct tmp dirname instead of hardcoded /tmp For example, on some systems, $rep might be saved in /tmp/$USER/ instead of /tmp/. --- contrib/dump-asy.pl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/contrib/dump-asy.pl b/contrib/dump-asy.pl index 3ebdb858..478a896a 100755 --- a/contrib/dump-asy.pl +++ b/contrib/dump-asy.pl @@ -13,6 +13,7 @@ use warnings; use Data::Dumper; use AnyEvent::I3; use File::Temp; +use File::Basename; use v5.10; my $i3 = i3(); @@ -75,4 +76,5 @@ say $tmp "draw(n" . $root->{id} . ", (0, 0));"; close($tmp); my $rep = "$tmp"; $rep =~ s/asy$/eps/; -system("cd /tmp && asy $tmp && gv --scale=-1000 --noresize --widgetless $rep && rm $rep"); +my $tmp_dir = dirname($rep); +system("cd $tmp_dir && asy $tmp && gv --scale=-1000 --noresize --widgetless $rep && rm $rep"); -- 2.39.5