瀏覽代碼

look for plugins to extend rehash and which

pull/360/head^2
Jamis Buck 13 年之前
父節點
當前提交
b6ebc2f08b
共有 2 個文件被更改,包括 29 次插入7 次删除
  1. +21
    -7
      libexec/rbenv-rehash
  2. +8
    -0
      libexec/rbenv-which

+ 21
- 7
libexec/rbenv-rehash 查看文件

@ -1,14 +1,28 @@
#!/usr/bin/env bash -e
mkdir -p "${HOME}/.rbenv/shims"
cd "${HOME}/.rbenv/shims"
rm -f *
make_shims() {
local glob="$@"
for file in ../versions/*/bin/*; do
shim="${file##*/}"
cat > "$shim" <<SH
for file in $glob; do
local shim="${file##*/}"
cat > "$shim" <<SH
#!/bin/sh
exec rbenv exec $shim "\$@"
SH
chmod +x "$shim"
chmod +x "$shim"
done
}
mkdir -p "${HOME}/.rbenv/shims"
cd "${HOME}/.rbenv/shims"
rm -f *
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

+ 8
- 0
libexec/rbenv-which 查看文件

@ -4,6 +4,14 @@ RBENV_VERSION="$(rbenv-version)"
RBENV_COMMAND="$1"
RBENV_COMMAND_PATH="${HOME}/.rbenv/versions/${RBENV_VERSION}/bin/${RBENV_COMMAND}"
shopt -s nullglob
RBENV_WHICH_PLUGINS=(/etc/rbenv.d/which/*.bash ${HOME}/.rbenv/rbenv.d/which/*.bash)
shopt -u nullglob
for script in $RBENV_WHICH_PLUGINS; do
source $script
done
if [ -x "$RBENV_COMMAND_PATH" ]; then
echo "$RBENV_COMMAND_PATH"
else

Loading…
取消
儲存