Skip to content

Handle dangling Xcode selection symlinks#6

Open
hstdt wants to merge 1 commit into
XcodesOrg:mainfrom
hstdt:fix/dangling-xcode-symlink
Open

Handle dangling Xcode selection symlinks#6
hstdt wants to merge 1 commit into
XcodesOrg:mainfrom
hstdt:fix/dangling-xcode-symlink

Conversation

@hstdt

@hstdt hstdt commented Jul 22, 2026

Copy link
Copy Markdown

Problem

Creating a new selection link fails when /Applications/Xcode.app is a dangling symlink.

FileManager.fileExists(atPath:) follows symlinks and returns false when the destination is missing. As a result, the existing symlink is not removed, and creating its replacement fails because an item named Xcode.app still exists.

Changes

Use attributesOfItem(atPath:) to inspect the filesystem entry itself, allowing dangling symlinks to be identified and replaced.

Real Xcode app bundles remain protected from being overwritten.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant