Fix: Use builtin cd for nvm_cd function#3836
Conversation
ljharb
left a comment
There was a problem hiding this comment.
either way, this would need a regression test.
|
Seems the Alternative fixes:
|
|
if there's no universal posix-compliant way to bypass functions, then there's not much that can be done - can you modify your |
|
I also thought about |
|
seems macOS 10.15.8 Debian 12 |
|
I propose this version as next: nvm_cd() {
if command -v builtin >/dev/null 2>&1; then
builtin cd "$@"
else
\cd "$@"
fi
}WDYT? |
|
It'd be nice to define one of two functions conditionally rather than always have to check for |
|
I did think about conditional function definition, but as the rest of the code doesn't do anything like this, I proposed to skip that part. Very likely, defining a function conditionally causes some incompatibility issue, perhaps there's a shell that doesn't allow it, i.e., it considers such code as function re-definition. |
|
Unclear why two jobs failed in CI. No error is printed, just bad exit code. |
|
Those are supposed to fail; you can ignore them. |
Use a more reliable built-in command invocation
|
Seems it's this issue: Found from And long-standing GitHub bug of not having a proper UI for that: |
What to do with these?
|
Use a more reliable built-in command invocation.
Fixes #3835
The previous fix 942e9ab (#1284) was not sufficient.