mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-05-24 17:51:49 +02:00
Improve symlink
This commit is contained in:
11
.github/workflows/onpush_builder.yaml
vendored
11
.github/workflows/onpush_builder.yaml
vendored
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user