From ed1cd4fffa9dcfb6eb1cf23a53d9956b4efbf10d Mon Sep 17 00:00:00 2001 From: Llewellyn van der Merwe Date: Mon, 3 Jun 2024 18:15:45 +0200 Subject: [PATCH] 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. --- src/octopower | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/octopower b/src/octopower index e82223d..36f46cb 100755 --- a/src/octopower +++ b/src/octopower @@ -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