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

« back to all changes in this revision

Viewing changes to libexec/rbenv-sh-shell

  • 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
version="$1"
 
13
 
 
14
if [ -z "$version" ]; then
 
15
  if [ -z "$RBENV_VERSION" ]; then
 
16
    echo "rbenv: no shell-specific version configured" >&2
 
17
    exit 1
 
18
  else
 
19
    echo "echo \"\$RBENV_VERSION\""
 
20
    exit
 
21
  fi
 
22
fi
 
23
 
 
24
if [ "$version" = "--unset" ]; then
 
25
  echo "unset RBENV_VERSION"
 
26
  exit 1
 
27
fi
 
28
 
 
29
# Make sure the specified version is installed.
 
30
rbenv-prefix "$version" >/dev/null
 
31
 
 
32
echo "export RBENV_VERSION=\"${version}\""