mirror of
https://github.com/pyenv/pyenv.git
synced 2025-11-09 12:03:49 -05:00
Fix $PWD changes when executing Python
Specifically, this does not play well with PWD=/proc/self/cwd
This commit is contained in:
@@ -60,9 +60,10 @@ resolve_link() {
|
||||
}
|
||||
|
||||
abs_dirname() {
|
||||
local cwd="$(pwd)"
|
||||
local path="$1"
|
||||
|
||||
# Use a subshell to avoid modifying the current path
|
||||
(
|
||||
while [ -n "$path" ]; do
|
||||
cd "${path%/*}"
|
||||
local name="${path##*/}"
|
||||
@@ -70,7 +71,7 @@ abs_dirname() {
|
||||
done
|
||||
|
||||
pwd
|
||||
cd "$cwd"
|
||||
)
|
||||
}
|
||||
|
||||
capitalize() {
|
||||
|
||||
Reference in New Issue
Block a user