mirror of
https://github.com/pyenv/pyenv.git
synced 2024-11-07 20:31:01 -05:00
6938692ca2
/usr/bin/env seems to have problems with arguments to bash on some platforms. To bypass this, use set -e instead.
37 lines
645 B
Bash
Executable file
37 lines
645 B
Bash
Executable file
#!/usr/bin/env bash
|
|
set -e
|
|
|
|
create_prototype_shim() {
|
|
cat > .rbenv-shim <<SH
|
|
#!/usr/bin/env bash
|
|
set -e
|
|
exec rbenv exec "\${0##*/}" "\$@"
|
|
SH
|
|
chmod +x .rbenv-shim
|
|
}
|
|
|
|
make_shims() {
|
|
local glob="$@"
|
|
|
|
for file in $glob; do
|
|
local shim="${file##*/}"
|
|
[ -e "$shim" ] || ln -f .rbenv-shim "$shim"
|
|
done
|
|
}
|
|
|
|
mkdir -p "${HOME}/.rbenv/shims"
|
|
cd "${HOME}/.rbenv/shims"
|
|
rm -f *
|
|
|
|
create_prototype_shim
|
|
make_shims ../versions/*/bin/*
|
|
|
|
shopt -s nullglob
|
|
RBENV_REHASH_PLUGINS=(/etc/rbenv.d/rehash/*.bash ${HOME}/.rbenv/rbenv.d/rehash/*.bash)
|
|
shopt -u nullglob
|
|
|
|
for script in ${RBENV_REHASH_PLUGINS[@]}; do
|
|
source $script
|
|
done
|
|
|
|
rm -f .rbenv-shim
|