Skip to content

Bug: dorothy install and setup-system update attempt to symlink $DOROTHY to itself on macOS 15.4 arm64 #294

@jondpenton

Description

@jondpenton

Summary

When running the install script (bash -ixc "$(curl -fsSL https://dorothy.bevry.me/install)"), I receive the following error:

+ ln -sfF -- /Users/jondpenton/.local/share/dorothy /Users/jondpenton/.local/share/dorothy
ln: /Users/jondpenton/.local/share/dorothy: Directory not empty

Debug Log

dorothy-install.log

Potential Solution

I was able to get dorothy install and setup-system update working by applying the following changes to commands/dorothy:

diff --git a/commands/dorothy b/commands/dorothy
index a9a12f91..d91a2e28 100755
--- a/commands/dorothy
+++ b/commands/dorothy
@@ -667,15 +667,19 @@ function dorothy_() (
 	function relocate_then_symlink_if_necessary {
 		local symlink="$1" destination="$2"
 		relocate_if_necessary "$symlink" "$destination"
-		if __is_alpine; then
-			# alpine doesn't support -F, however the removals of relocate_if_necessary should make it unnecessary
-			ln -sf -- "$destination" "$symlink"
-		else
-			# -F: replace symlink if directory if needed
-			# -f: unlink symlink path if needed
-			# -s: symbolic link
-			ln -sfF -- "$destination" "$symlink"
+
+		if [[ "$symlink" != "$destination" ]]; then
+			if __is_alpine; then
+				# alpine doesn't support -F, however the removals of relocate_if_necessary should make it unnecessary
+				ln -sf -- "$destination" "$symlink"
+			else
+				# -F: replace symlink if directory if needed
+				# -f: unlink symlink path if needed
+				# -s: symbolic link
+				ln -sfF -- "$destination" "$symlink"
+			fi
 		fi
+
 		# cleanup accidents
 		symlink="$symlink/$(basename -- "$destination")"
 		if [[ -L $symlink ]]; then

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions