diff options
author | John Ankarström <john@ankarstrom.se> | 2021-07-19 22:33:00 +0200 |
---|---|---|
committer | John Ankarström <john@ankarstrom.se> | 2021-07-19 22:33:00 +0200 |
commit | 9a6d64954e78cdb6e4900a0985d90ff644a6a8c8 (patch) | |
tree | 21ab46353a46515f42c8206407e6c0fd7385a3fe | |
parent | aa6c30a140afbe7bb850f0b8eb85c5be9c281d5d (diff) | |
download | xutil-9a6d64954e78cdb6e4900a0985d90ff644a6a8c8.tar.gz |
wpdf: Fix build/make handling
-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'); } |