Skip to content

Commit a0ec6fe

Browse files
committed
Fix patch extension shellcheck [skip ci]
1 parent 743ee01 commit a0ec6fe

1 file changed

Lines changed: 12 additions & 4 deletions

File tree

scripts/patch-extensions.sh

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# shellcheck shell=bash
2+
# shellcheck disable=SC2016
13
# Function to add CFLAGS without duplicating them across extension patches.
24
add_cflags() {
35
local flag
@@ -45,8 +47,10 @@ configure_imagick() {
4547
exit 1
4648
fi
4749
[[ "$PHP_VERSION" = "5.6" ]] && add_cflags -Wno-incompatible-pointer-types -Wno-int-conversion
48-
export CPPFLAGS="$(pkg-config --cflags "$PKG_WAND")"
49-
export LDFLAGS="$(pkg-config --libs "$PKG_WAND")"
50+
CPPFLAGS="$(pkg-config --cflags "$PKG_WAND")"
51+
LDFLAGS="$(pkg-config --libs "$PKG_WAND")"
52+
export CPPFLAGS
53+
export LDFLAGS
5054
}
5155

5256
# Function to patch imagick source.
@@ -125,7 +129,9 @@ patch_xdebug() {
125129

126130
# Function to move to xhprof extension source.
127131
patch_xhprof() {
128-
[ -d extension ] && cd extension
132+
if [ -d extension ]; then
133+
cd extension || return 1
134+
fi
129135
return 0
130136
}
131137

@@ -182,7 +188,9 @@ patch_ds() {
182188

183189
# Function to move to maxminddb extension source.
184190
patch_maxminddb() {
185-
[ -d ext ] && cd ext
191+
if [ -d ext ]; then
192+
cd ext || return 1
193+
fi
186194
[[ "$PHP_VERSION" = "8.6" ]] && patch_xt_offsetof_tree .
187195
return 0
188196
}

0 commit comments

Comments
 (0)