#!/bin/bash -e

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

export RTFMd_WIKI

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