Use 'grealpath' if installed for realpath fallback#3374
Use 'grealpath' if installed for realpath fallback#3374floam merged 2 commits intofish-shell:masterfrom
Conversation
See discussion in fish-shell#3370
|
The idea is probably correct, though I'd actually define the function here instead of going via |
|
II thought alias was just syntax to define a wrapped function. What else does it do? |
share/functions/realpath.fish
Outdated
| function realpath --description 'fallback realpath implementation' | ||
| builtin fish_realpath $argv[-1] | ||
| end | ||
| if not command -v realpath > /dev/null |
There was a problem hiding this comment.
FWIW, I think we should be using command -s rather than command -v in the scripts we ship since our command(1) man page documents -s as a first class flag and -v as being recognized only for compatibility with other implementations.
|
I'm closing this because it does not solve the real problem. That problem is that This change does not fix that error. It instead papers over the problem with a OS X/macOS specific change. And it does so in a manner that introduces other problems. |
|
No - what this was trying to fix was just the fish script failing to pick up realpath if it's prefixed with a 'g'. |
|
I think it's unlikely even in the cases where it is calle 8000 d with the same number of arguments, that our bare-bones builtin would be preferred. |
|
I have also since gotten this a little less likely to do wrong things. |
d84fde1 to
71c0f45
Compare
Per feedback do not use aliases to declare wrapped functions.
|
Meh - I'm just going to merge it. It appears to be working better. |
Description
Per #3370, our realpath builtin/wrapper function will not use GNU realpath if installed on BSD with a 'g' prefix.