diff options
Diffstat (limited to 'etc/wpdf')
-rwxr-xr-x | etc/wpdf | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -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'); } |