Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

file 33 lines (29 sloc) 0.965 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
# -*- mode: shell-script -*-
#
# This is designed to be sourced by the various other 'run' scripts in order to
# establish the working environment. Do not edit this file! Instead, create a file
# 'bootstrap.user', and set additional env vars / paths there.

if [ -z "$BASH" ] && [ -z "$ZSH_VERSION" ]; then
  echo "Error: need /bin/sh to point to either zsh or bash"
  exit 2
fi

BASE=$(dirname "$(readlink "$0")")
BASE=$("$BASE/readlink_canonical" "$BASE")
PATH=$BASE/script:$BASE/bin:$BASE:$PATH
export PATH
export USER=$(id -un)
export RAILS_ENV=production
APP_DIR=$BASE/app # Don't expand this link, as deployments can change the symlink chain
if [ ! -d "$APP_DIR" ]; then
  echo "no such app dir: $APP_DIR (did you create a symlink to your Rails app?)" 1>&2;
  exit 2
fi

function maybe_bundled () {
  if [ -f "$APP_DIR/Gemfile" ]; then
    echo "bundle exec $@"
  else
    echo "$@"
  fi
}

[[ -s "$BASE/bootstrap.user" ]] && . "$BASE/bootstrap.user"
true
Something went wrong with that request. Please try again.