From 6b91c63f774b19043f50cb366895855ccf11f2fc Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Fri, 21 Mar 2025 08:07:39 +0100 Subject: [PATCH] Improve symlink --- .github/workflows/onpush_builder.yaml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/onpush_builder.yaml b/.github/workflows/onpush_builder.yaml index 8af3f9aea..fe4f8b392 100644 --- a/.github/workflows/onpush_builder.yaml +++ b/.github/workflows/onpush_builder.yaml @@ -134,10 +134,17 @@ jobs: # Find all symlinks and replace them with the real files or directories find . -type l | while read -r link; do target="$(readlink -f "$link")" - # Remove the symlink + if [ -z "$target" ]; then + echo "Skipping broken symlink: $link" + continue + fi + rm "$link" + + # If target is directory, copy contents into link's parent directory if [ -d "$target" ]; then - cp -R "$target" "$link" + mkdir -p "$link" + cp -a "$target/." "$link/" else cp "$target" "$link" fi