mirror of
https://github.com/nvm-sh/nvm.git
synced 2025-11-04 23:17:11 +00:00
[Fix] sh lacks -O; thanks shellcheck
This commit is contained in:
parent
9602f4f959
commit
18e638e42b
3
nvm.sh
3
nvm.sh
@ -2985,7 +2985,8 @@ nvm_check_file_permissions() {
|
|||||||
if [ ! -L "${FILE}" ] && ! nvm_check_file_permissions "${FILE}"; then
|
if [ ! -L "${FILE}" ] && ! 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" ] && [ -z "$(command find "${FILE}" -prune -user "$(command id -u)")" ]; then
|
||||||
|
# ^ file ownership check from https://www.shellcheck.net/wiki/SC3067
|
||||||
nvm_err "file is not writable or self-owned: $(nvm_sanitize_path "$FILE")"
|
nvm_err "file is not writable or self-owned: $(nvm_sanitize_path "$FILE")"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user