#!/bin/bash -e

if [[ -n $1 ]]; then
  GOLEM_WIKI=$1; shift
else
  GOLEM_WIKI=$(pwd)
fi

export GOLEM_WIKI

bundle check 2>&- || { bundle install --local && bundle check; }
exec bundle exec thin start -R config/golem.ru
