From ad826e9065ce5eb58fde94e5cbf14443039e5c7a Mon Sep 17 00:00:00 2001 From: Joey Parrish Date: Wed, 21 Feb 2024 11:00:18 -0800 Subject: [PATCH] Fix command parsing --- .github/workflows/commands/lib.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/commands/lib.sh b/.github/workflows/commands/lib.sh index 04f6f09..f48305d 100644 --- a/.github/workflows/commands/lib.sh +++ b/.github/workflows/commands/lib.sh @@ -72,10 +72,10 @@ function parse_command() { local INDEX for (( INDEX=0; INDEX < ${#TOKENS[@]}; INDEX++ )); do - if [[ "${TOKENS[i]}" == "/bot" ]]; then - BOT_COMMAND="${TOKENS[i+1]}" - # A slice of all tokens starting with index i+2. - BOT_ARGUMENTS=( "${TOKENS[@]:i+2}" ) + if [[ "${TOKENS[INDEX]}" == "/bot" ]]; then + BOT_COMMAND="${TOKENS[INDEX+1]}" + # A slice of all tokens starting with INDEX+2. + BOT_ARGUMENTS=( "${TOKENS[@]:INDEX+2}" ) return 0 fi done