nvm
nvm copied to clipboard
bypass aliased curl
Use command curl ~add nvm_curl~ so that we can bypass aliased curl.
Context: https://github.com/nvm-sh/nvm/issues/2923#issuecomment-1299535388
With these changes, there's only two places
nvm_curlis needed, which suggests that inliningcommandmay be a better choice?if we keep
nvm_curl, we need to remember to unset it indeactivate. also, there may be tests mockingcurlthat need to now mocknvm_curl.
Indeed, with only 2 places need the -q option I agree it's simpler to avoid the nvm_curl function, which also make testing less complicated. I've updated the PR accordingly.
Testa are failing on master
Looking at the failed test here: https://app.travis-ci.com/github/nvm-sh/nvm/jobs/586754000
✗ nvm_list_aliases works with LTS aliases expected lts/gallium, got >lts/hydrogen<
I believe it's because of outdated test data. hopefully it can be fixed by https://github.com/nvm-sh/nvm/pull/2933
Unfortunately it’s much more difficult than that; xenial can’t build node 18 and newer Ubuntus can’t build node 0.6.
Checked, all looks as if will work as expected and resolves #2923
Running the edited command curl for me does not log the edited one.
Got tests passing on master and rebased this.
@ryenus tests are still failing - specifically the ones that mock curl. are you interested in completing this PR? if not, please leave it open so I (or another contributor) can give it a shot :-)
@ljharb I just realized that the test for nvm_curl_libz_support assumes that curl can be redefined as a shell function, therefore I'm keeping it as-is.
@ryenus indeed - so i think that with this PR's change, to keep that test passing, we'd have to make the test instead mock out the PATH and provide an actual fake curl binary.
so i think that with this PR's change, to keep that test passing, we'd have to make the test instead mock out the PATH and provide an actual fake
curlbinary.
@ljharb you're right, though IMHO it's a bit too much, as I think in the original issue it's likely a problem with the specific alias definition, not that the curl command cannot be aliased. If that's fine I'd like to close the pr instead.
Let's keep it open; I'll try to get back to it and finish it.