mirror of
https://github.com/pyenv/pyenv.git
synced 2025-12-22 06:01:28 +09:00
rehash: support BSD mktemp (#3376)
macOS 12 `mktemp' doesn't support `-p`
This commit is contained in:
parent
aeea3ac825
commit
a944da76c0
@ -52,7 +52,7 @@ while (( SECONDS <= start + ${PYENV_REHASH_TIMEOUT:-60} )); do
|
||||
#So check for writablity by trying to write to a different file,
|
||||
# in a way that taxes the usual use case as little as possible.
|
||||
if [[ -z $tested_for_other_write_errors ]]; then
|
||||
( t="$(mktemp -p "$SHIM_PATH")" && rm "$t" ) && tested_for_other_write_errors=1 ||
|
||||
( t="$(TMPDIR="$SHIM_PATH" mktemp)" && rm "$t" ) && tested_for_other_write_errors=1 ||
|
||||
{ echo "pyenv: cannot rehash: $SHIM_PATH isnt writable" >&2; break; }
|
||||
fi
|
||||
# POSIX sleep(1) doesn't provide subsecond precision, but many others do
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user