Merge pull request #527 from DrSmoothl/main-fix

fix: 修复webUI未正确处理行末注释的问题
pull/530/head
HYY 2025-03-21 17:39:45 +08:00 committed by GitHub
commit 13e5fae29c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 1 deletions

View File

@ -98,10 +98,14 @@ def parse_env_config(config_file):
# 逐行处理配置
for line in lines:
line = line.strip()
# 忽略空行和注释
# 忽略空行和注释
if not line or line.startswith("#"):
continue
# 处理行尾注释
if "#" in line:
line = line.split("#")[0].strip()
# 拆分键值对
key, value = line.split("=", 1)