Handle bind-mounted dist during runtime init

This commit is contained in:
2026-04-13 09:11:30 +08:00
parent b76f51a1aa
commit ce80e50aec
+17
View File
@@ -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")"