Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
34 lines (29 sloc) 965 Bytes
# -*- 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