Skip to content

Commit 3fa9d53

Browse files
committed
[Fix] sh lacks -O; thanks shellcheck
1 parent f9e254e commit 3fa9d53

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

nvm.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2985,7 +2985,8 @@ nvm_check_file_permissions() {
29852985
if [ ! -L "${FILE}" ] && ! nvm_check_file_permissions "${FILE}"; then
29862986
return 2
29872987
fi
2988-
elif [ -e "$FILE" ] && [ ! -w "$FILE" ] && [ ! -O "$FILE" ]; then
2988+
elif [ -e "$FILE" ] && [ ! -w "$FILE" ] && [ -z "$(command find "${FILE}" -prune -user "$(command id -u)")" ]; then
2989+
# ^ file ownership check from https://www.shellcheck.net/wiki/SC3067
29892990
nvm_err "file is not writable or self-owned: $(nvm_sanitize_path "$FILE")"
29902991
return 1
29912992
fi

0 commit comments

Comments
 (0)