From ad0e7f8bc3d06439c346d868bcc9daefb864dfba Mon Sep 17 00:00:00 2001 From: Arvin <62139570+wnlen@users.noreply.github.com> Date: Sat, 21 Mar 2026 17:17:13 +0800 Subject: [PATCH] Update generate_config.sh --- scripts/generate_config.sh | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/scripts/generate_config.sh b/scripts/generate_config.sh index dfb9ee6..2a10923 100644 --- a/scripts/generate_config.sh +++ b/scripts/generate_config.sh @@ -131,17 +131,22 @@ apply_secret_to_config() { apply_controller_to_config() { local file="$1" - local ui_dir="$PROJECT_DIR/ui/dist" + local ui_src="$PROJECT_DIR/ui/dist" + local ui_dir="$RUNTIME_DIR/ui" if [ "$EXTERNAL_CONTROLLER_ENABLED" = "true" ]; then upsert_yaml_kv_local "$file" "external-controller" "$EXTERNAL_CONTROLLER" - if [ -f "$ui_dir/index.html" ]; then - upsert_yaml_kv_local "$file" "external-ui" "$ui_dir" - else - echo "[ERROR] UI not found: $ui_dir/index.html" >&2 + if [ ! -f "$ui_src/index.html" ]; then + echo "[ERROR] UI not found: $ui_src/index.html" >&2 exit 1 fi + + rm -rf "$ui_dir" + mkdir -p "$ui_dir" + cp -a "$ui_src/." "$ui_dir/" + + upsert_yaml_kv_local "$file" "external-ui" "$ui_dir" else remove_yaml_key_local "$file" "external-controller" remove_yaml_key_local "$file" "external-ui"