Skip to content

fix: do not throw error when resolving symlink of a plain directory#47

Merged
fortmarek merged 1 commit intomainfrom
symlink/directory
Oct 7, 2024
Merged

fix: do not throw error when resolving symlink of a plain directory#47
fortmarek merged 1 commit intomainfrom
symlink/directory

Conversation

@fortmarek
Copy link
Copy Markdown
Member

As of now, resolveSymbolicLink throws an error if the passed path is not a symbolic link.

For tuist/tuist purposes, we often don't know if a given path is or is not symbolic link since it depends on the user input or specific xcodebuild behavior.

I believe it's better to simply return the path without resolving if the file/directory is not a symlink instead of throwing.

Alternatively, we could add an isSymbolicLink method and let the consumers of the library ensure resolveSymbolicLink is called only for actual symlinks. But in tuist/tuist, we would have to do this dance almost everywhere we end up using resolveSymbolicLink, which is why I'm leaning to the former.

@fortmarek fortmarek requested a review from pepicrft October 7, 2024 08:39
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.

2 participants