Permalink
Switch branches/tags
Nothing to show
Find file
70ce9fd Jan 11, 2011
executable file 42 lines (36 sloc) 806 Bytes
#!/bin/bash
BALLS_LIB=$(dirname $0)/../lib
BALLS_LIB=$(readlink -f "$BALLS_LIB") # expand the ../
mode=$1; shift
while getopts 'e:C:' opt; do
case $opt in
C)
BALLS_CONF=$OPTARG
;;
e)
BALLS_ENV=$OPTARG
;;
\?)
echo "Usage: $0 <mode> [options]"
echo
echo 'Options:'
echo ' -e <env> the server environment, BALLS_ENV'
echo ' default: development'
echo
echo ' -C <path> path to the balls conf file, BALLS_CONF'
echo ' default: ./config/$BALLS_ENV.sh'
;;
esac
done
[[ -z "$BALLS_ENV" ]] && BALLS_ENV=development
[[ -z "$BALLS_CONF" ]] && BALLS_CONF=./config/$BALLS_ENV.sh
. "$BALLS_CONF"
. $BALLS_LIB/balls.sh
case $mode in
server)
balls::$mode
;;
*)
echo "unknown"
;;
esac