`uninstall`: add `NVM_DEBUG` to print out a filename as its permissions are checked

Jordan Harband 2020-03-05 17:40:17 -08:00
parent 4626d1aae6
commit 096ba0d8c3
No known key found for this signature in database
GPG Key ID: 9F6A681E35EF8B56
1 changed files with 4 additions and 1 deletions

5
nvm.sh
View File

@ -2327,7 +2327,10 @@ nvm_check_file_permissions() {
nvm_is_zsh && setopt local_options nonomatch nvm_is_zsh && setopt local_options nonomatch
for FILE in "$1"/* "$1"/.[!.]* "$1"/..?* ; do for FILE in "$1"/* "$1"/.[!.]* "$1"/..?* ; do
if [ -d "$FILE" ]; then if [ -d "$FILE" ]; then
if ! nvm_check_file_permissions "$FILE"; then if [ -n "${NVM_DEBUG-}" ]; then
nvm_err "${FILE}"
fi
if ! nvm_check_file_permissions "${FILE}"; then
return 2 return 2
fi fi
elif [ -e "$FILE" ] && [ ! -w "$FILE" ] && [ ! -O "$FILE" ]; then elif [ -e "$FILE" ] && [ ! -w "$FILE" ] && [ ! -O "$FILE" ]; then