bin/setup
#!/usr/bin/env sh
# Set up Rails app. Run this script immediately after cloning the codebase.
# Exit if any subcommand fails
set -e
# Set up Ruby dependencies via Bundler
gem install bundler --conservative
bundle check || bundle install
# Set up configurable environment variables
if [ ! -f .env ]; then
cp .env.example .env
fi
# Set up database and add any development seed data
bundle exec rake db:setup dev:prime
# Pick a port for Foreman
if ! grep --quiet --no-messages --fixed-strings 'port' .foreman; then
printf 'port: 3000\n' >> .foreman
fi
echo "DONE"