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

« back to all changes in this revision

Viewing changes to libexec/rbenv-local

  • 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
# Provide rbenv completions
 
6
if [ "$1" = "--complete" ]; then
 
7
  echo --unset
 
8
  echo system
 
9
  exec rbenv-versions --bare
 
10
fi
 
11
 
 
12
RBENV_VERSION="$1"
 
13
RBENV_VERSION_FILE=".rbenv-version"
 
14
 
 
15
if [ "$RBENV_VERSION" = "--unset" ]; then
 
16
  rm -f "$RBENV_VERSION_FILE"
 
17
elif [ -n "$RBENV_VERSION" ]; then
 
18
  rbenv-version-file-write "$RBENV_VERSION_FILE" "$RBENV_VERSION"
 
19
else
 
20
  rbenv-version-file-read "$RBENV_VERSION_FILE" ||
 
21
  { echo "rbenv: no local version configured for this directory"
 
22
    exit 1
 
23
  } >&2
 
24
fi