-
Notifications
You must be signed in to change notification settings - Fork 782
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(fish): use builtin realpath over system one #1637
Conversation
These changes also resolve the issue on macOS because system I just updated to the latest realpath: illegal option -- -
usage: realpath [-q] [path ...]
Welcome to fish, the friendly interactive shell
Type help for instructions on how to use fish
> ~ @MageJohn's patch fixes the problem. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great contribution, thanks!
You can use this change by pulling the latest code with |
Any idea when will this be released? |
@rebebop at least according to github releases, 0.13.1 was release 4 minutes ago, so give it some time :) |
@rebebop if you're rushing, you can edit the Just add if test -z $ASDF_DIR
set ASDF_DIR (builtin realpath --no-symlinks (dirname (status filename)))
end
# ... |
@kblcuk All good :), when I posted, which was an hour ago, it was obviously not released so was only wondering. |
Summary
Fixes the issue raised in a PR comment here: #1583 (comment)
Fish treats their
realpath
builtin as a fallback in case a system version doesn't exist. Not all versions ofrealpath
support the--no-symlinks
flag, whichasdf.fish
uses. This PR ensures that the builtin version ofrealpath
is always used.Other Information
Just as a note for posterity, the
--no-symlinks
flag for the builtinrealpath
was added in fish 3.2.0, released in March 1, 2021. 2 years old is good, but some slower Linux distros may lack support. If that proves to be a problem, then perhaps a different solution can be found. I think long term though the builtin will offer the best support across different systems.