~ubuntu-branches/ubuntu/wily/rbenv/wily

« back to all changes in this revision

Viewing changes to libexec/rbenv-version-file

  • Committer: Package Import Robot
  • Author(s): Antonio Terceiro
  • Date: 2011-09-24 12:27:44 UTC
  • Revision ID: package-import@ubuntu.com-20110924122744-gpszt0huloxxzu6f
Tags: upstream-0.1.2+git20100922
ImportĀ upstreamĀ versionĀ 0.1.2+git20100922

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/env bash
 
2
set -e
 
3
[ -n "$RBENV_DEBUG" ] && set -x
 
4
 
 
5
root="$(pwd)"
 
6
while [ -n "$root" ]; do
 
7
  if [ -e "${root}/.rbenv-version" ]; then
 
8
    echo "${root}/.rbenv-version"
 
9
    exit
 
10
  fi
 
11
  root="${root%/*}"
 
12
done
 
13
 
 
14
GLOBAL_PATH="${RBENV_ROOT}/global"
 
15
DEFAULT_PATH="${RBENV_ROOT}/default"
 
16
 
 
17
if [ -e "$GLOBAL_PATH" ]; then
 
18
  echo "$GLOBAL_PATH"
 
19
elif [ -e "$DEFAULT_PATH" ]; then
 
20
  echo "$DEFAULT_PATH"
 
21
else
 
22
  echo "$GLOBAL_PATH"
 
23
fi