checking for consistency in the image dir
[sgn-devtools.git] / view_lint.pl
blobae784d8715e0a0574b9b54f48e51dcb8d03e9277
1 #!/usr/bin/env perl
2 use POSIX;
3 use File::Temp qw/tempfile/;
5 my $u=shift;
7 my (undef,$weblint_temp) = tempfile();
8 my (undef,$wget_temp) = tempfile();
9 warn "$weblint_temp, $wget_temp\n";
10 unless(my $wlpid = fork) {
11 open \*STDOUT, '>', $weblint_temp;
12 system qw|weblint --context 3 |, $u
13 and die 'error running weblint';
14 print "*** weblint done ***\n";
15 POSIX::_exit(0);
16 } else {
17 system 'wget', -O => $wget_temp, $u
18 and die "error running wget ($!)";
19 waitpid $wlpid, 0;
22 system "$ENV{EDITOR} $weblint_temp $wget_temp"
23 and die "$! executing \$ENV{EDITOR} '$ENV{EDITOR}'";
25 for ($weblint_temp, $wget_temp) {
26 unlink $_
27 or warn "$! unlinking $_\n";