From 9a6d64954e78cdb6e4900a0985d90ff644a6a8c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Mon, 19 Jul 2021 22:33:00 +0200 Subject: wpdf: Fix build/make handling --- etc/wpdf | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/etc/wpdf b/etc/wpdf index 077b699..bbfae4b 100755 --- a/etc/wpdf +++ b/etc/wpdf @@ -72,8 +72,14 @@ open my $p, '-|', 'watch', keys %deptarget or die "could not start watch: $!\n"; while (<$p>) { chomp; - my $cmd = ($_ =~ /\.pdf$/) ? 'make' : 'build'; - my $arg = ($_ =~ /\.pdf$/) ? $deptarget{$_} : $depsource{$_}; + my ($cmd, $arg); + if (exists $depsource{$_}) { + $cmd = 'build'; + $arg = $depsource{$_}; + } else { + $cmd = 'make'; + $arg = $deptarget{$_}; + } system($cmd, $arg) == 0 && system('xpdf', '-remote', "wpdf-$deptarget{$_}", '-reload'); } -- cgit v1.2.3