mirror of
https://github.com/apisnetworks/pyenv.git
synced 2026-11-30 19:59:01 +00:00
Exclude .dylib from pyenv-commands
Since it's not actually a command, but a binary lib, and better avoid it unexpectedly appearing in `commands`.
This commit is contained in:
1 parent
0dea25c4b3
commit
cf4d2f13e1
2 files changed
+13
No files matched your search
@@ -39,6 +39,7 @@ shopt -s nullglob
|
|||||||
else
|
else
|
||||||
for path in "${paths[@]}"; do
|
for path in "${paths[@]}"; do
|
||||||
for command in "${path}"/pyenv-*; do
|
for command in "${path}"/pyenv-*; do
|
||||||
|
[[ $command == *.dylib ]] && continue
|
||||||
command="${command##*/pyenv-}"
|
command="${command##*/pyenv-}"
|
||||||
if [[ -n $nosh ]]; then
|
if [[ -n $nosh ]]; then
|
||||||
if [[ ${command:0:3} != "sh-" ]]; then
|
if [[ ${command:0:3} != "sh-" ]]; then
|
||||||
|
|||||||
@@ -31,6 +31,18 @@ load test_helper
|
|||||||
assert_line "hello"
|
assert_line "hello"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@test "commands excludes .dylib files" {
|
||||||
|
path="${PYENV_TEST_DIR}/commands"
|
||||||
|
mkdir -p "$path"
|
||||||
|
touch "${path}/pyenv-hello" "${path}/pyenv-realpath.dylib"
|
||||||
|
chmod +x "${path}/pyenv-hello" "${path}/pyenv-realpath.dylib"
|
||||||
|
|
||||||
|
PATH="${path}:$PATH" run pyenv-commands
|
||||||
|
assert_success
|
||||||
|
assert_line "hello"
|
||||||
|
refute_line "realpath.dylib"
|
||||||
|
}
|
||||||
|
|
||||||
@test "commands --no-sh" {
|
@test "commands --no-sh" {
|
||||||
run pyenv-commands --no-sh
|
run pyenv-commands --no-sh
|
||||||
assert_success
|
assert_success
|
||||||
|
|||||||
Reference in new issue
Block a user