summaryrefslogtreecommitdiff
path: root/bin/setup
blob: 7d8c7428568230a3f72bc5e9cde86cefd8a6bf21 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/bin/env sh

# Set up Rails app. Run this script immediately after cloning the codebase.
# https://github.com/thoughtbot/guides/tree/master/protocol

# Exit if any subcommand fails
set -e

# Set up Ruby dependencies via Bundler
bundle install --path vendor/bundle -j 4

# Set up configurable environment variables
if [ ! -f .env ]; then
  cp .env.example .env
fi

if [ ! -f config/database.yml ]; then
  cp config/database.yml.example config/database.yml
fi

# Print warning if Foreman is not installed
if ! command -v foreman &>/dev/null; then
  echo "foreman is not installed."
  echo "See https://github.com/ddollar/foreman for install instructions."
fi