Verified Commit 132d6648 authored by Vladimír Štill's avatar Vladimír Štill
Browse files

makefilter: Wrap command instead of using pipe (to respect exitcode)

parent 0ed180c3
......@@ -7,9 +7,10 @@ use v5.16;
$|++;
open(my $full, ">", "make-full.log");
open(my $make, "-|", @ARGV);
my $cut = 0;
while (<>) {
while (<$make>) {
print $full $_;
s/(error)/colored($1, 'bright_red')/ei;
print if not $cut;
......@@ -18,3 +19,9 @@ while (<>) {
say "[[[log cut by makefilter, full log in make-full.log]]]";
}
}
if (not close($make)) {
my $exit = $? >> 8;
my $sig = $? & 0xff;
die "Error closing handle to make: $!" if $! != 0;
exit $exit + $sig;
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment