Skip to content

Commit 5c51f59

Browse files
committed
fix(base): cater for AMP_CONTAINER_DEPS not set
1 parent f3d02f7 commit 5c51f59

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

scripts/base/ampstart.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,11 @@ chown -R amp:amp /home/amp 2>/dev/null
2828
[ -f /AMP/AMP_Linux_${ARCH} ] && chmod +x /AMP/AMP_Linux_${ARCH}
2929

3030
# Install extra dependencies if needed
31-
mapfile -t REQUIRED_DEPS < <(jq -r '.[]' <<<"${AMP_CONTAINER_DEPS}")
31+
REQUIRED_DEPS=()
32+
if [[ -n "${AMP_CONTAINER_DEPS:-}" ]]; then
33+
# shellcheck disable=SC2207
34+
REQUIRED_DEPS=($(jq -r '.[]? | select(type=="string" and length>0)' <<<"${AMP_CONTAINER_DEPS}" || echo))
35+
fi
3236
if ((${#REQUIRED_DEPS[@]})); then
3337
echo "[Info] Installing extra dependencies..."
3438
DEBIAN_FRONTEND="noninteractive"

0 commit comments

Comments
 (0)