Skip to content

Commit 329c927

Browse files
committed
refactor: use suggested shellcheck solution to prevent implicit concatenations
Signed-off-by: Maximilian Bösing <[email protected]>
1 parent 89eba26 commit 329c927

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

scripts/extensions.sh

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,16 @@ ENABLED_EXTENSIONS=$(php -m | tr '[:upper:]' '[:lower:]' | egrep -v '^[\[]' | gr
9494
EXTENSIONS_TO_INSTALL=()
9595

9696
add_extension_to_install() {
97-
local extension=$1
97+
local EXTENSION=$1
9898

9999
# Prevent duplicates
100-
if [[ ! " ${EXTENSIONS_TO_INSTALL[@]} " =~ " ${extension} " ]]; then
101-
EXTENSIONS_TO_INSTALL+=("${extension}")
102-
fi
100+
for TO_BE_INSTALLED in "${EXTENSIONS_TO_INSTALL[@]}"; do
101+
if [[ "${TO_BE_INSTALLED}" == "${EXTENSION}" ]]; then
102+
return
103+
fi
104+
done
105+
106+
EXTENSIONS_TO_INSTALL+=("${EXTENSION}")
103107
}
104108

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

0 commit comments

Comments
 (0)