main
 1#!/bin/sh
 2
 3# bin/bootstrap: Resolve all dependencies that the application requires to run.
 4set -e
 5
 6cd "$(dirname "$0")/.."
 7
 8if [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ]; then
 9  brew bundle check >/dev/null 2>&1  || {
10    echo "==> Installing Homebrew dependencies…"
11    brew bundle
12  }
13fi
14
15if [ -f ".ruby-version" ] && [ -z "$(rbenv version-name 2>/dev/null)" ]; then
16  echo "==> Installing Ruby…"
17  rbenv install --skip-existing
18  command -v bundle >/dev/null 2>&1  || {
19    gem install bundler
20    rbenv rehash
21  }
22fi
23
24if [ -f "Gemfile" ]; then
25  echo "==> Installing gem dependencies…"
26  bundle check --path vendor/bundle >/dev/null 2>&1 || {
27    bundle install --path vendor/bundle --quiet
28  }
29fi