core: 修复在 el 的 sh 下无法运行

This commit is contained in:
bin456789
2026-04-12 18:10:09 +08:00
parent 2d676731bb
commit ae3ad40c75

View File

@ -33,7 +33,9 @@ export LC_ALL=C
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$PATH export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$PATH
# 如果不是 bash 的话,继续执行会有语法错误,因此在这里判断是否 bash # 如果不是 bash 的话,继续执行会有语法错误,因此在这里判断是否 bash
if [ -z "$BASH" ]; then if [ -z "$BASH" ] ||
# el 的 sh 是 bash 运行在 posix 模式,依然有 $BASH 和 $BASH_VERSION
{ [ -n "$BASH" ] && [ -n "$POSIXLY_CORRECT" ]; }; then
if ! command -v bash >/dev/null; then if ! command -v bash >/dev/null; then
if [ -f /etc/alpine-release ]; then if [ -f /etc/alpine-release ]; then
if ! apk add bash; then if ! apk add bash; then