From ce80e50aecb7725ada5142b34c5ff9321f5ba1b7 Mon Sep 17 00:00:00 2001 From: yuanzhen869 Date: Mon, 13 Apr 2026 09:11:30 +0800 Subject: [PATCH] Handle bind-mounted dist during runtime init --- tools/init_runtime_data.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tools/init_runtime_data.sh b/tools/init_runtime_data.sh index d393f34..db32028 100644 --- a/tools/init_runtime_data.sh +++ b/tools/init_runtime_data.sh @@ -34,6 +34,23 @@ init_path() { src_path="$APP_ROOT/$rel_path" dst_path="$DATA_ROOT/$rel_path" + # Bind-mounted paths like /app/dist cannot be removed and replaced with symlinks. + # Keep the mount in place and only ensure the runtime copy exists. + if [ "$rel_path" = "dist" ]; then + if [ -d "$src_path" ]; then + if [ ! -e "$dst_path" ] && [ ! -L "$dst_path" ]; then + mkdir -p "$(dirname "$dst_path")" + cp -a "$src_path" "$dst_path" + else + sync_missing_dir_entries "$src_path" "$dst_path" + fi + elif [ ! -e "$dst_path" ] && [ ! -L "$dst_path" ]; then + mkdir -p "$(dirname "$dst_path")" + cp -a "$src_path" "$dst_path" + fi + return + fi + if [ -d "$src_path" ]; then if [ ! -e "$dst_path" ] && [ ! -L "$dst_path" ]; then mkdir -p "$(dirname "$dst_path")"