Fix deployment: No more symlinks in dist.

This commit is contained in:
baldo 2022-07-11 12:13:06 +02:00
commit 73ef6ac422
3 changed files with 30 additions and 3 deletions

27
bin/dist-fix-symlinks.sh Executable file
View file

@ -0,0 +1,27 @@
#!/usr/bin/env bash
set -e
cd "$(dirname "${BASH_SOURCE[0]}")/.."
echo "Fixing symlinks in dist:"
if [[ ! -d "dist" ]]; then
echo " Error: Directory dist does not exist."
exit 1
fi
cd dist
find . -type l | while read symlink; do
target=$(readlink -e "$symlink")
if [[ -z "$target" ]] || [[ ! -f "$target" ]]; then
echo " Could not resolve symlink in dist: $symlink"
exit 1
fi
echo " $symlink"
rsync "$target" "$symlink" -az --copy-links
done
echo "Done"