소스 검색

Add rbenv-whence to show you which versions of Ruby have a given command

pull/360/head^2
Sam Stephenson 15 년 전
부모
커밋
d257b562e5
1개의 변경된 파일22개의 추가작업 그리고 0개의 파일을 삭제
  1. +22
    -0
      libexec/rbenv-whence

+ 22
- 0
libexec/rbenv-whence 파일 보기

@ -0,0 +1,22 @@
#!/usr/bin/env bash -e
if [ "$1" = "--path" ]; then
print_paths="1"
shift
else
print_paths=""
fi
whence() {
local command="$1"
rbenv-versions --bare | while read version; do
path="$(rbenv-prefix "$version")/bin/${command}"
if [ -x "$path" ]; then
[ "$print_paths" ] && echo "$path" || echo "$version"
fi
done
}
RBENV_COMMAND="$1"
result="$(whence "$RBENV_COMMAND")"
[ -n "$result" ] && echo "$result"

불러오는 중...
취소
저장