aboutsummaryrefslogtreecommitdiff
path: root/etc/wpdf
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2021-07-19 22:33:00 +0200
committerJohn Ankarström <john@ankarstrom.se>2021-07-19 22:33:00 +0200
commit9a6d64954e78cdb6e4900a0985d90ff644a6a8c8 (patch)
tree21ab46353a46515f42c8206407e6c0fd7385a3fe /etc/wpdf
parentaa6c30a140afbe7bb850f0b8eb85c5be9c281d5d (diff)
downloadxutil-9a6d64954e78cdb6e4900a0985d90ff644a6a8c8.tar.gz
wpdf: Fix build/make handling
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');
}