Move conda.txt and source.txt into their directory to allow users to have custom blacklist

This commit is contained in:
Yamashita, Yuu 2017-07-21 00:43:23 +00:00
parent 52d6acc3b0
commit 753a9e826b
7 changed files with 20 additions and 5 deletions

View file

@ -12,11 +12,13 @@ conda_exists() {
} }
shims=() shims=()
for shim in $(cat "${BASH_SOURCE%/*}/conda.txt"); do shopt -s nullglob
if [ -n "${shim%%#*}" ]; then for shim in $(cat "${BASH_SOURCE%/*}/conda.d/"*".list" | sort | uniq | sed -e 's/#.*$//' | sed -e '/^[[:space:]]*$/d'); do
if [ -n "${shim##*/}" ]; then
shims[${#shims[*]}]="${shim})return 0;;" shims[${#shims[*]}]="${shim})return 0;;"
fi fi
done done
shopt -u nullglob
eval "conda_shim(){ case \"\$1\" in ${shims[@]} *)return 1;;esac;}" eval "conda_shim(){ case \"\$1\" in ${shims[@]} *)return 1;;esac;}"
# override `make_shims` to avoid conflict between pyenv-virtualenv's `envs.bash` # override `make_shims` to avoid conflict between pyenv-virtualenv's `envs.bash`

3
pyenv.d/rehash/conda.d/.gitignore vendored Normal file
View file

@ -0,0 +1,3 @@
*
!/.gitignore
!/default.list

View file

@ -1,11 +1,13 @@
PROTOTYPE_SOURCE_SHIM_PATH="${SHIM_PATH}/.pyenv-source-shim" PROTOTYPE_SOURCE_SHIM_PATH="${SHIM_PATH}/.pyenv-source-shim"
shims=() shims=()
for shim in $(cat "${BASH_SOURCE%/*}/source.txt"); do shopt -s nullglob
if [ -n "${shim%%#*}" ]; then for shim in $(cat "${BASH_SOURCE%/*}/source.d/"*".list" | sort | uniq | sed -e 's/#.*$//' | sed -e '/^[[:space:]]*$/d'); do
if [ -n "${shim##*/}" ]; then
shims[${#shims[*]}]="${shim})return 0;;" shims[${#shims[*]}]="${shim})return 0;;"
fi fi
done done
shopt -u nullglob
eval "source_shim(){ case \"\$1\" in ${shims[@]} *)return 1;;esac;}" eval "source_shim(){ case \"\$1\" in ${shims[@]} *)return 1;;esac;}"
cat > "${PROTOTYPE_SOURCE_SHIM_PATH}" <<SH cat > "${PROTOTYPE_SOURCE_SHIM_PATH}" <<SH

3
pyenv.d/rehash/source.d/.gitignore vendored Normal file
View file

@ -0,0 +1,3 @@
*
!/.gitignore
!/default.list

View file

@ -0,0 +1,6 @@
# virtualenv
activate
activate.csh
activate.fish
# gettext (#688)
gettext.sh

View file

@ -1 +0,0 @@
gettext.sh