From 5f453914a04c193baf5b4239d83116d33a74de62 Mon Sep 17 00:00:00 2001 From: walker0643 <> Date: Wed, 21 Feb 2018 16:55:55 -0500 Subject: [PATCH] contrib/dump-asy.pl: add prerequisites check and fix warnings about empty container names --- contrib/dump-asy.pl | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/contrib/dump-asy.pl b/contrib/dump-asy.pl index 4fcf9b77..9bb2db3a 100755 --- a/contrib/dump-asy.pl +++ b/contrib/dump-asy.pl @@ -15,6 +15,12 @@ use AnyEvent::I3; use File::Temp; use File::Basename; use v5.10; +use IPC::Cmd qw[can_run]; + +# prerequisites check so we can be specific about failures caused +# by not having these tools in the path +can_run('asy') or die 'Please install asymptote'; +can_run('gv') or die 'Please install gv'; my $i3 = i3(); @@ -31,7 +37,7 @@ sub dump_node { my $o = ($n->{orientation} eq 'none' ? "u" : ($n->{orientation} eq 'horizontal' ? "h" : "v")); my $w = (defined($n->{window}) ? $n->{window} : "N"); - my $na = $n->{name}; + my $na = ($n->{name} or "[Empty]"); $na =~ s/#/\\#/g; $na =~ s/\$/\\\$/g; $na =~ s/&/\\&/g; -- 2.39.2