Files
fizzy/bin/setup
T
2024-09-06 16:28:51 -04:00

30 lines
498 B
Bash
Executable File

#!/usr/bin/env bash
set -eo pipefail
# Use application binstubs
export PATH="./bin:$PATH"
announce() {
printf "\n--- $@\n"
}
announce "Installing dependencies"
gem install bundler --conservative
bundle check || bundle install
announce "Preparing database"
if [[ $* == *--reset* ]]; then
rails db:reset
else
rails db:prepare
fi
announce "Removing old logs and tempfiles"
rails log:clear tmp:clear
announce "Restarting services"
rails restart
echo
echo "Start developing with ./bin/dev"