From 18ec7b1c1a8bf8f5d58f32bdcd8cf79d18a58d0b Mon Sep 17 00:00:00 2001 From: Tsu-ba-me Date: Wed, 28 Jul 2021 19:13:20 -0400 Subject: [PATCH] fix(Anvil): abort when no new Apache conf created --- Anvil/Tools/Striker.pm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Anvil/Tools/Striker.pm b/Anvil/Tools/Striker.pm index 3d4ff45f..cad450b6 100644 --- a/Anvil/Tools/Striker.pm +++ b/Anvil/Tools/Striker.pm @@ -100,7 +100,7 @@ sub check_httpd_conf if (not -s $anvil->data->{path}{data}{httpd_conf}) { - # The apache config file doesn't exist or is empty. + # The apache config file doesn't exist or is empty; abort. return(0); } @@ -213,6 +213,13 @@ sub check_httpd_conf } }); my $new_httpd_conf = $anvil->data->{path}{data}{httpd_conf}.".augnew"; + + if (not -s $new_httpd_conf) + { + # No new conf file created; abort. + return(0); + } + my $diff_output = diff $anvil->data->{path}{data}{httpd_conf}, $new_httpd_conf, { STYLE => 'Unified' }; $anvil->Log->variables({ source => $THIS_FILE, line => __LINE__, level => $debug, list => { diff_output => $diff_output } });