Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Allow choosing rbenv and rbenv-installer branch via env variable.

  • Loading branch information...
commit 396f45dc0a39ce6f53634cae2e7e5550ebbf8199 1 parent bef4598
@justinclift justinclift authored
Showing with 19 additions and 6 deletions.
  1. +19 −6 bin/rbenv-installer
View
25 bin/rbenv-installer
@@ -14,22 +14,35 @@ rbenv_git_init(){
cd $RBENV_ROOT
if [ ! -d '.git' ]; then
git init
- git remote add -t $BRANCH origin https://github.com/sstephenson/rbenv.git
+ git remote add -t $RBENV_BRANCH origin https://github.com/sstephenson/rbenv.git
git remote update origin
- git checkout $BRANCH
+ git checkout $RBENV_BRANCH
fi
}
+# If the user hasn't specified which rbenv branch
+# to install, we default to the master branch
+if [ "x$RBENV_BRANCH" = "x" ]; then
+ RBENV_BRANCH=master
+fi
+
# Install rbenv:
-BRANCH=master
if [ ! -d "$RBENV_ROOT" ] ; then
mkdir -p $RBENV_ROOT
rbenv_git_init
else
rbenv_git_init
- git pull origin master
+ git pull origin $RBENV_BRANCH
+fi
+
+
+# If the user hasn't specified which rbenv-install branch
+# to install, we default to the development branch
+if [ "x$INSTALLER_BRANCH" = "x" ]; then
+ INSTALLER_BRANCH=develop
fi
+# Install rbenv-installer
KEY=fesplugas
VALUE=rbenv-installer
RBENV_PLUGIN_ROOT="${RBENV_ROOT}/plugins/$VALUE"
@@ -38,9 +51,9 @@ if [ ! -d "$RBENV_PLUGIN_ROOT" ] ; then
mkdir -p $RBENV_PLUGIN_ROOT
cd $RBENV_PLUGIN_ROOT
git init
- git remote add -t $BRANCH origin https://github.com/$KEY/$VALUE.git
+ git remote add -t $INSTALLER_BRANCH origin https://github.com/$KEY/$VALUE.git
git remote update origin
- git checkout $BRANCH
+ git checkout $INSTALLER_BRANCH
else
cd $RBENV_PLUGIN_ROOT
git pull
Please sign in to comment.
Something went wrong with that request. Please try again.