Skip to content

Commit d5db45f

Browse files
committed
Improved compatibility of CJK font installation on Alpine.
1 parent 06bb023 commit d5db45f

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

rootfs/etc/cont-init.d/15-cjk-font.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,13 @@ if is-bool-val-true "${ENABLE_CJK_FONT:-0}"; then
99
echo "CJK font already installed."
1010
else
1111
echo "installing CJK font..."
12-
if [ -n "$(which apk)" ]; then
13-
add-pkg font-wqy-zenhei --repository "${PACKAGES_MIRROR:-https://dl-cdn.alpinelinux.org/alpine}/edge/community"
12+
if command -v apk >/dev/null; then
13+
if apk --no-cache info font-wqy-zenhei > /dev/null
14+
then
15+
add-pkg font-wqy-zenhei
16+
else
17+
add-pkg font-wqy-zenhei --repository "${PACKAGES_MIRROR:-https://dl-cdn.alpinelinux.org/alpine}/v3.19/community"
18+
fi
1419
else
1520
add-pkg fonts-wqy-zenhei
1621
fi

0 commit comments

Comments
 (0)