mod/scriptrunonce: resolve nested conditions

This commit is contained in:
Christian Hesse 2025-02-12 14:01:10 +01:00
parent b7b3b43f3b
commit 1c957dbc6d

View file

@ -36,18 +36,17 @@
:return false; :return false;
} }
:if ([ :len $Source ] > 0) do={ :if ([ $ValidateSyntax $Source ] = false) do={
:if ([ $ValidateSyntax $Source ] = true) do={ $LogPrint warning $0 ("The script '" . $Script . "' failed syntax validation!");
:return false;
}
:do { :do {
$LogPrint info $0 ("Running script '" . $Script . "' now."); $LogPrint info $0 ("Running script '" . $Script . "' now.");
[ :parse $Source ]; [ :parse $Source ];
} on-error={ } on-error={
$LogPrint warning $0 ("The script '" . $Script . "' failed to run!"); $LogPrint warning $0 ("The script '" . $Script . "' failed to run!");
} }
} else={
$LogPrint warning $0 ("The script '" . $Script . "' failed syntax validation!");
}
}
} }
} on-error={ } on-error={
:global ExitError; $ExitError false $0; :global ExitError; $ExitError false $0;