Skip to content

Commit

Permalink
options options options
Browse files Browse the repository at this point in the history
  • Loading branch information
jneen committed Jan 12, 2011
1 parent 461550b commit 70ce9fd
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
9 changes: 4 additions & 5 deletions bin/balls
Expand Up @@ -2,8 +2,6 @@
BALLS_LIB=$(dirname $0)/../lib
BALLS_LIB=$(readlink -f "$BALLS_LIB") # expand the ../

. $BALLS_LIB/balls.sh

mode=$1; shift

while getopts 'e:C:' opt; do
Expand All @@ -27,10 +25,11 @@ while getopts 'e:C:' opt; do
esac
done

[ -z "$BALLS_ENV" ] && BALLS_ENV=development
[ -z "$BALLS_CONF" ] && BALLS_CONF=./config/$BALLS_ENV.sh

[[ -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)
Expand Down
12 changes: 10 additions & 2 deletions lib/balls.sh
@@ -1,13 +1,21 @@
#!/bin/bash
[[ -z "$BALLS_LIB" ]] && BALLS_LIB=.

[[ -z "$BALLS_CONF" ]] && BALLS_CONF=./config.sh
[[ -z "$BALLS_ROOT" ]] && BALLS_ROOT=$(readlink -f "$(dirname $BALLS_CONF)/../")
[[ -z "$BALLS_LIB" ]] && BALLS_LIB=$(dirname $0)

[[ -z "$TMP_DIR" ]] && TMP_DIR=/tmp/balls
[[ -d "$TMP_DIR" ]] && mkdir "$TMP_DIR"
[[ -z "$BALLS_TMP" ]] && BALLS_TMP=/tmp/balls
[[ -d "$BALLS_TMP" ]] || mkdir "$BALLS_TMP"

[[ -z "$BALLS_PORT" ]] && BALLS_PORT=3000

[[ -z "$BALLS_VIEWS" ]] && BALLS_VIEWS=$BALLS_ROOT/views
[[ -z "$BALLS_ACTIONS" ]] && BALLS_ACTIONS=$BALLS_ROOT/actions


. $BALLS_LIB/util.sh
. $BALLS_LIB/http.sh
. $BALLS_LIB/router.sh
. $BALLS_LIB/server.sh
. $BALLS_ACTIONS/*.sh

0 comments on commit 70ce9fd

Please sign in to comment.