Skip to content

Commit ef1bc24

Browse files
committed
feat: Compatible with docker compose
1 parent 63e95e2 commit ef1bc24

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

bin/tools/Base.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export TIME_STYLE='+%Y-%m-%d %H:%M:%S'
1313
# 检查应该生效哪一个配置, 对应的优先级关系为: 当前工作目录(WorkDir), config中指定的工作目录(GamePath)
1414

1515
# 加载局部配置覆盖全局配置, 当前目录中的minecraftctl.conf文件优先级最高
16-
if [ -e "${WorkDir}/minecraftctl.conf" ]; then
16+
if [[ -e "${WorkDir}/minecraftctl.conf" || -e "${WorkDir}/.env" ]]; then
1717
GamePath=$WorkDir
1818
fi
1919
# 如果工作目录没有被创建,就前往配置中的目录
@@ -25,6 +25,11 @@ if [ -e "${GamePath}/minecraftctl.conf" ]; then
2525
source minecraftctl.conf
2626
cd "${WorkDir}"
2727
fi
28+
if [ -e "${GamePath}/.env" ]; then
29+
cd "${GamePath}"
30+
source "${GamePath}/.env"
31+
cd "${WorkDir}"
32+
fi
2833
cd ${GamePath}
2934

3035
# i18n文件内容缓存

0 commit comments

Comments
 (0)