Skip to content

Commit

Permalink
Fix variable name mismatch in nightly script (#25229)
Browse files Browse the repository at this point in the history
`nightlysubs` defines `$ignoreError`, but the `nightly` script uses
`$ignoreErrors`. I renamed the former to the latter, because it reads
nicer.

Reviewed by @lydia-duncan -- thanks!

## Testing
- [x] `nightly` with deliberately broken `chpldoc` does not send email
  • Loading branch information
DanilaFe authored Jun 13, 2024
2 parents ed7a3e5 + b81768b commit d4a7e89
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion util/cron/nightly
Original file line number Diff line number Diff line change
Expand Up @@ -841,7 +841,7 @@ if ($runtests == 0) {
$splice = "$utildir/devel/test/spliceDat";
$spliceCommand = "$splice -from_a $today -to_a $today $svnPerfDir/$datName $historicalFile> $tmpDatDir/$datName";
$spliceDatMessage = "Attempting to splice historical data $historicalFile with nightly data $svnPerfDir/$datName";
mysystem($spliceCommand, $spliceMessage, $ignoreError, 1);
mysystem($spliceCommand, $spliceMessage, $ignoreErrors, 1);
`cp $svnPerfDir/$datName $tmpNightlyDatDir/$datName`;
}

Expand Down
6 changes: 3 additions & 3 deletions util/cron/nightlysubs.pm
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ unlink($file);
# be one of three values.
#
# * $exitOnError (aka <exit on error>): exit the script if the command fails
# * $ignoreError (aka <ignore error>): silently allow the error to fail
# * $ignoreErrors (aka <ignore errors>): silently allow the error to fail
# * a path to a file: write the error to that file and continue
$exitOnError = "<exit on error>";
$ignoreError = "<ignore error>";
$ignoreErrors = "<ignore errors>";
sub mysystem {
$command = $_[0];
$errorname = $_[1];
Expand All @@ -36,7 +36,7 @@ sub mysystem {
print "Error $errorname: $status\n";
if ($onerror eq $exitOnError) {
exit 1;
} elsif ($onerror eq $ignoreError) {
} elsif ($onerror eq $ignoreErrors) {
# Do nothing
} else {
open(my $SF, '>>', $onerror) or die "Could not open file '$onerror' $!";
Expand Down

0 comments on commit d4a7e89

Please sign in to comment.