Extract load_ql_envs function and reorder initialization in docker-entrypoint.sh and update.sh

Co-authored-by: whyour <22700758+whyour@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot] 2025-11-14 14:53:23 +00:00
parent 9a877ddc22
commit cef8b3a312
3 changed files with 11 additions and 5 deletions

View File

@ -19,9 +19,10 @@ log_with_style() {
}
log_with_style "INFO" "🚀 1. 检测配置文件..."
import_config "$@"
load_ql_envs
export_ql_envs
. $dir_shell/env.sh
import_config "$@"
fix_config
pm2 l &>/dev/null

View File

@ -84,16 +84,20 @@ init_env() {
export PYTHONUNBUFFERED=1
}
import_config() {
[[ -f $file_config_user ]] && . $file_config_user
load_ql_envs() {
ql_base_url=${QlBaseUrl:-"/"}
ql_port=${QlPort:-"5700"}
ql_grpc_port=${QlGrpcPort:-"5500"}
current_branch=${QL_BRANCH:-""}
}
import_config() {
[[ -f $file_config_user ]] && . $file_config_user
load_ql_envs
command_timeout_time=${CommandTimeoutTime:-""}
file_extensions=${RepoFileExtensions:-"js py"}
proxy_url=${ProxyUrl:-""}
current_branch=${QL_BRANCH:-""}
if [[ -n "${DefaultCronRule}" ]]; then
default_cron="${DefaultCronRule}"

View File

@ -3,6 +3,7 @@
dir_shell=$QL_DIR/shell
. $dir_shell/share.sh
. $dir_shell/api.sh
load_ql_envs
. $dir_shell/env.sh
send_mark=$dir_shell/send_mark