This website works better with JavaScript.
首頁
探索
說明
登入
isprogram
/
pyenv
镜像来自
https://github.com/pyenv/pyenv.git
關註
1
收藏
0
複製
0
程式碼
問題管理
0
Projects
0
版本發佈
241
Wiki
Activity
瀏覽代碼
Fix $PWD changes when executing Python
Specifically, this does not play well with PWD=/proc/self/cwd
pull/1036/head
Zach Riggle
8 年之前
父節點
eef042ad89
當前提交
19e2b9588a
共有
4 個文件被更改
,包括
18 次插入
和
13 次删除
分割檢視
Diff Options
Show Stats
Download Patch File
Download Diff File
+9
-6
libexec/pyenv
+3
-3
libexec/pyenv-hooks
+3
-2
libexec/pyenv-versions
+3
-2
plugins/python-build/bin/python-build
+ 9
- 6
libexec/pyenv
查看文件
@ -36,9 +36,10 @@ else
}
abs_dirname() {
local cwd="$PWD"
local path="$1"
# Use a subshell to avoid changing the current path
(
while [ -n "$path" ]; do
cd "${path%/*}"
local name="${path##*/}"
@ -46,7 +47,7 @@ else
done
pwd
cd "$cwd"
)
}
fi
@ -72,11 +73,13 @@ fi
if [ -z "${PYENV_DIR}" ]; then
PYENV_DIR="$PWD"
else
cd "$PYENV_DIR" 2>/dev/null || abort "cannot change working directory to \`$PYENV_DIR'"
PYENV_DIR="$PWD"
cd "$OLDPWD"
fi
if [ ! -d "$PYENV_DIR" ] || [ ! -e "$PYENV_DIR" ]; then
abort "cannot change working directory to \`$PYENV_DIR'"
fi
PYENV_DIR=$(cd "$PYENV_DIR" && echo "$PWD")
export PYENV_DIR
+ 3
- 3
libexec/pyenv-hooks
查看文件
@ -37,10 +37,10 @@ resolve_link() {
}
realpath() {
local cwd="$PWD"
local path="$1"
local name
# Use a subshell to avoid changing the current path
(
while [ -n "$path" ]; do
name="${path##*/}"
[ "$name" = "$path" ] || cd "${path%/*}"
@ -48,7 +48,7 @@ realpath() {
done
echo "${PWD}/$name"
cd "$cwd"
)
}
fi
+ 3
- 2
libexec/pyenv-versions
查看文件
@ -44,10 +44,11 @@ if ! enable -f "${BASH_SOURCE%/*}"/pyenv-realpath.dylib realpath 2>/dev/null; th
}
realpath() {
local cwd="$PWD"
local path="$1"
local name
# Use a subshell to avoid changing the current path
(
while [ -n "$path" ]; do
name="${path##*/}"
[ "$name" = "$path" ] || cd "${path%/*}"
@ -55,7 +56,7 @@ if ! enable -f "${BASH_SOURCE%/*}"/pyenv-realpath.dylib realpath 2>/dev/null; th
done
echo "${PWD}/$name"
cd "$cwd"
)
}
fi
+ 3
- 2
plugins/python-build/bin/python-build
查看文件
@ -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() {
Write
Preview
Loading…
取消
儲存