1
0
mirror of https://github.com/nvm-sh/nvm.git synced 2025-02-06 09:26:13 +00:00

[Fix] bash_completion: be robust when cd is overridden

This commit is contained in:
Gilad Barnea 2021-09-13 15:26:40 +03:00 committed by Jordan Harband
parent 59532c74c6
commit d91087c333
No known key found for this signature in database
GPG Key ID: 9F6A681E35EF8B56

View File

@ -58,7 +58,7 @@ __nvm_aliases() {
declare aliases
aliases=""
if [ -d "${NVM_DIR}/alias" ]; then
aliases="$(cd "${NVM_DIR}/alias" && command find "${PWD}" -type f | command sed "s:${PWD}/::")"
aliases="$(command cd "${NVM_DIR}/alias" && command find "${PWD}" -type f | command sed "s:${PWD}/::")"
fi
echo "${aliases} node stable unstable iojs"
}