Skip comments in loadPower function

A new condition has been added to the loadPower function in src/octopower to identify and skip lines that start with //, which are treated as comments. Previously, the function validated and processed all lines without filtering out comments.
This commit is contained in:
Llewellyn van der Merwe 2024-06-03 18:15:45 +02:00
parent 223c972795
commit ed1cd4fffa
Signed by: Llewellyn
GPG Key ID: A9201372263741E7

View File

@ -228,7 +228,9 @@ function setPowers() {
# load the power
function loadPower() {
local guid="$1"
if [ ${#guid} -ge 30 ] && validateGuid "${guid}"; then
if [[ $guid == "//"* ]]; then
return 0 # skip comments ;)
elif [ ${#guid} -ge 30 ] && validateGuid "${guid}"; then
setPower "$guid" || return 19
loadChildrenPowers "$guid" || return 19
return 0