Fix more bugs (create relative symlink)

This commit is contained in:
Santiago Lo Coco 2022-02-06 18:09:14 -03:00
parent 9b49f2fbb2
commit 9bb6e4b72d
1 changed files with 3 additions and 3 deletions

View File

@ -1,14 +1,14 @@
#!/usr/bin/env bash
getAnyPackages() {
mapfile -t pkgs < <(find -H "any" -mindepth 1 -type f -regex '.*.pkg.tar.zst.*')
mapfile -t pkgs < <(find -H "$PWD/any" -mindepth 1 -type f -regex '.*.pkg.tar.zst.*')
for arch in "x86_64" "i686" "aarch64"; do
cd "$arch" || { echo "Couldn't cd into '$arch'." 1>&2 && exit 1; }
for pkg in "${pkgs[@]}"; do
if [ "$dryRunFlag" = false ]; then
ln -sf "$pkg" "$(basename "$pkg")"
ln -srf "$pkg" "$(basename "$pkg")"
else
echo "ln -sf $pkg $(basename "$pkg")"
echo "ln -srf $pkg $(basename "$pkg")"
fi
done
cd .. || { echo "Couldn't cd into the parent folder." 1>&2 && exit 1; }