Improve symlink

This commit is contained in:
Alexandre
2025-03-21 08:07:39 +01:00
committed by GitHub
parent 2ca5577ba1
commit 6b91c63f77

View File

@@ -134,10 +134,17 @@ jobs:
# Find all symlinks and replace them with the real files or directories # Find all symlinks and replace them with the real files or directories
find . -type l | while read -r link; do find . -type l | while read -r link; do
target="$(readlink -f "$link")" target="$(readlink -f "$link")"
# Remove the symlink if [ -z "$target" ]; then
echo "Skipping broken symlink: $link"
continue
fi
rm "$link" rm "$link"
# If target is directory, copy contents into link's parent directory
if [ -d "$target" ]; then if [ -d "$target" ]; then
cp -R "$target" "$link" mkdir -p "$link"
cp -a "$target/." "$link/"
else else
cp "$target" "$link" cp "$target" "$link"
fi fi