From e5316ddbe36f28c2faa1c96c7473f6b026bfb0aa Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Sun, 13 Nov 2016 00:09:29 -0800 Subject: [PATCH] [Fix] allow uninstalls when files are nonwritable but self-owned. Fixes #1270. --- nvm.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nvm.sh b/nvm.sh index ab1e356269..1a6798fdd7 100755 --- a/nvm.sh +++ b/nvm.sh @@ -2090,8 +2090,8 @@ nvm_check_file_permissions() { fi return 2 fi - elif [ -e "$FILE" ] && [ ! -w "$FILE" ]; then - nvm_err "file is not writable: $(nvm_sanitize_path "$FILE")" + elif [ -e "$FILE" ] && [ ! -w "$FILE" ] && [ ! -O "$FILE" ]; then + nvm_err "file is not writable or self-owned: $(nvm_sanitize_path "$FILE")" if [ "${ZSH_HAS_NONOMATCH_UNSET}" -eq 1 ] && nvm_has "setopt"; then setopt nomatch fi