Merge pull request #2995 from orestisf1993/dump-asy-basename

dump-asy.pl: use correct tmp dirname instead of hardcoded /tmp
This commit is contained in:
Ingo Bürk 2017-09-27 21:46:00 +02:00 committed by GitHub
commit 9aa016cffd
1 changed files with 3 additions and 1 deletions

View File

@ -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");