dorothy icon indicating copy to clipboard operation
dorothy copied to clipboard

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

Open jondpenton opened this issue 8 months ago • 1 comments

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

jondpenton avatar May 10 '25 22:05 jondpenton

Thanks Jon. I'll make sure this is fixed in #281 if it is not already.

balupton avatar May 11 '25 05:05 balupton

#281 has rewritten this functionality with the new fs-mv command, which also resolves this issue.

balupton avatar Jun 28 '25 12:06 balupton

this still happens as of 28 october 2025. fresh install of mac os 26

bash -ic "$(curl -fsSL https://dorothy.bevry.me/install)"
/Users/bazo/.zshrc -> /Users/bazo/.config/zsh/.zshrc
Installing Dorothy into /Users/bazo/.local/share/dorothy from https://github.com/bevry/dorothy
git clone --quiet --no-tags https://github.com/bevry/dorothy.git /Users/bazo/.local/share/dorothy
git checkout --quiet HEAD
ln: /Users/bazo/.local/share/dorothy: Directory not empty

bazo avatar Oct 28 '25 15:10 bazo

Yes, the resolve to this will be merged later this week. Everything is fixed. It just has to be merged into master now.

molleweide avatar Oct 28 '25 15:10 molleweide

@bazo there's still a few days more of touchups to do for #281 before merging, however you can give it a go via the instructions here: https://github.com/bevry/dorothy/issues/185#issuecomment-3446118658

Otherwise, wait a few days for me to ping back once it's merged.

balupton avatar Nov 01 '25 09:11 balupton

Closing as fixed within #281, which is now ready for merging, and will be merged shortly.

balupton avatar Nov 05 '25 20:11 balupton