From eefb5968de0f92d7a58d7904ba4146ec9ace9b7b Mon Sep 17 00:00:00 2001 From: Aminda Suomalainen Date: Sat, 3 Aug 2024 11:40:17 +0300 Subject: [PATCH] flatpakifier.bash: remove dangling symlinks in the end --- bash/flatpakifier.bash | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/bash/flatpakifier.bash b/bash/flatpakifier.bash index 5282eee..322523b 100755 --- a/bash/flatpakifier.bash +++ b/bash/flatpakifier.bash @@ -1,5 +1,6 @@ #!/usr/bin/env bash -# This script partially reverts https://gitea.blesmrt.net/mikaela/scripts/commit/e76a4a6a0d0472428d519205543171b1b1cdc258 +# This script partially reverts +# https://gitea.blesmrt.net/mikaela/scripts/commit/e76a4a6a0d0472428d519205543171b1b1cdc258 export FLATPAKEXPORTS=/var/lib/flatpak/exports/bin #export TARGETDIR=~/.local/bin @@ -27,4 +28,12 @@ ln -sfv $FLATPAKEXPORTS/im.dino.Dino $TARGETDIR/dino #ln -sfv $FLATPAKEXPORTS/chat.schildi.desktop $TARGETDIR/schildichat #ln -sfv $FLATPAKEXPORTS/org.signal.Signal $TARGETDIR/signal-desktop +# If symlinks is installed, run it against the target directory so dangling +# symlinks get removed and the path isn't polluted by non-existent items. +if hash symlinks 2> /dev/null; then + symlinks -d $TARGETDIR +else + echo "WARNING! Executable named symlinks not found in PATH." +fi + set +x