Skip to content

Commit

Permalink
refactor: use suggested shellcheck solution to prevent implicit conca…
Browse files Browse the repository at this point in the history
…tenations

Signed-off-by: Maximilian Bösing <[email protected]>
  • Loading branch information
boesing committed Sep 26, 2024
1 parent 89eba26 commit 329c927
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions scripts/extensions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,16 @@ ENABLED_EXTENSIONS=$(php -m | tr '[:upper:]' '[:lower:]' | egrep -v '^[\[]' | gr
EXTENSIONS_TO_INSTALL=()

add_extension_to_install() {
local extension=$1
local EXTENSION=$1

# Prevent duplicates
if [[ ! " ${EXTENSIONS_TO_INSTALL[@]} " =~ " ${extension} " ]]; then
EXTENSIONS_TO_INSTALL+=("${extension}")
fi
for TO_BE_INSTALLED in "${EXTENSIONS_TO_INSTALL[@]}"; do
if [[ "${TO_BE_INSTALLED}" == "${EXTENSION}" ]]; then
return
fi
done

EXTENSIONS_TO_INSTALL+=("${EXTENSION}")
}

# Loop through known statically compiled/installed extensions, and enable them.
Expand Down

0 comments on commit 329c927

Please sign in to comment.