[Perf] `nvm_check_file_permissions`: do not traverse into symlinks

Jordan Harband 2023-08-25 22:49:41 -07:00
parent c92adb3c47
commit 1eaaada499
No known key found for this signature in database
GPG Key ID: 9F6A681E35EF8B56
1 changed files with 1 additions and 1 deletions

2
nvm.sh
View File

@ -2784,7 +2784,7 @@ nvm_check_file_permissions() {
if [ -n "${NVM_DEBUG-}" ]; then
nvm_err "${FILE}"
fi
if ! nvm_check_file_permissions "${FILE}"; then
if [ ! -L "${FILE}" ] && ! nvm_check_file_permissions "${FILE}"; then
return 2
fi
elif [ -e "$FILE" ] && [ ! -w "$FILE" ] && [ ! -O "$FILE" ]; then