From 999d2a5fcfa8c61b01b89de0f0ca58858ebb940f Mon Sep 17 00:00:00 2001 From: tracer Date: Sun, 29 Mar 2026 20:48:06 +0200 Subject: [PATCH] fix Karabiner setup --- install.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/install.sh b/install.sh index c27ca0c..a6e02df 100755 --- a/install.sh +++ b/install.sh @@ -136,6 +136,15 @@ replace_dir() { link_dotfile() { source_path=$1 target_path=$2 + resolved_source_path=$(cd "$(dirname "$source_path")" && pwd)/$(basename "$source_path") + target_parent=$(dirname "$target_path") + resolved_target_parent=$(cd "$target_parent" 2>/dev/null && pwd || printf '%s' "$target_parent") + resolved_target_path=$resolved_target_parent/$(basename "$target_path") + + if [ "$resolved_source_path" = "$resolved_target_path" ]; then + skip "$target_path resolves to the source path; refusing to create a self-referential symlink." + return + fi if [ -L "$target_path" ]; then current_target=$(readlink "$target_path")