Perl: Close and delete output files when dying

This commit is contained in:
Andrew Johnson
2020-05-26 21:52:55 -05:00
parent 808cf80579
commit 7ba12f600c
4 changed files with 24 additions and 0 deletions

View File

@@ -108,6 +108,12 @@ if ($opt_D) { # Output dependencies only
open my $out, '>', $opt_o or
die "Can't create $opt_o: $!\n";
$SIG{__DIE__} = sub {
die @_ if $^S; # Ignore eval deaths
close $out;
unlink $opt_o;
};
my $podHtml;
my $idify;
my $contentType =