diff --git a/script/server b/script/server index d99c33056..4a0980a4c 100755 --- a/script/server +++ b/script/server @@ -61,6 +61,33 @@ then fatal "config/diaspora.yml is missing! Copy over config/diaspora.yml.example to config/diaspora.yml and edit it properly!" fi +# Check if detached head state +if git status | grep 'Changes not staged for commit' > /dev/null ; +then + warning "Your changes are not staged for commit. Kindly stash or commit them" +fi + +# Check if RVM available +if rvm -v | grep 'No command '"'"'rvm'"'"' found' > /dev/null ; +then + warning "RVM is not installed on the system. Please install it" +fi + +# Check if bundle is complete +if ! bundle check > /dev/null +then + fatal "Your bundle is not up to date, run the command \"bundle install\"" +fi + +# Check if database is migrated and correct gemset +if rake db:migrate:status | grep 'down' > /dev/null ; +then + warning "Your database is not migrated, run the command \"rake db:migrate\"" +elif rake db:migrate:status | grep 'rake aborted' > /dev/null ; +then + warning "The gemset is not correct" +fi + # Setup environment if [ -z "$RAILS_ENV" ] then