aboutsummaryrefslogtreecommitdiff
path: root/etc/wpdf
diff options
context:
space:
mode:
Diffstat (limited to 'etc/wpdf')
-rwxr-xr-xetc/wpdf10
1 files 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');
}