- Notifications
You must be signed in to change notification settings - Fork1.4k
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Switch back to resolving symlinks forrbenv
executable#1439
Conversation
Considerations:- `./libexec/rbenv` executable is the entrypoint to the program;- BASH_SOURCE might be the path to a symlink that has activated `./libexec/rbenv`;- We must resolve the symlink to learn where rbenv's libexec directory is;- It's not guaranteed that rbenv commands will always remain directly under their own "libexec" directory, since a package maintainer can change that, e.g. rbenv commands are sometimes placed into `/usr/libexec/rbenv/*`;- Resolving symlinks might fail and in that case we just assume rbenv project layout.
konsolebox commentedSep 27, 2022
How about the solution I suggested where
Can be changed to
|
Excellent suggestions; thank you!
That is also valid and I experimented with changing the |
konsolebox commentedSep 30, 2022
Master version is working again thank you. Just a minor thing to consider: If |
Ah, I didn't know that; thanks for explaining the distinction. I have been using |
Ah, only now I understand what you were saying: if someone did export a function called |
Considerations:
./libexec/rbenv
executable is the entrypoint to the program;BASH_SOURCE might be the path to a symlink that has activated
./libexec/rbenv
;We must resolve the symlink to learn where rbenv's libexec directory is;
It's not guaranteed that rbenv commands will always remain directly under their own "libexec" directory, since a package maintainer can change that, e.g. rbenv commands are sometimes placed into
/usr/libexec/rbenv/*
;Resolving symlinks might fail and in that case we just assume rbenv project layout.
Fixes#1437 /cc@konsolebox
Reverts parts of#1428, therefore reintroducing ~4ms overhead at runtime to properly detect the location of rbenv scripts. I could not find a simpler way to do this; suggestions welcome!