Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: re-sync bootstrap script from GH
From latest in github/scriptstorulethemall
- Loading branch information
Showing
1 changed file
with
26 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,31 @@ | ||
#!/bin/sh | ||
|
||
# script/bootstrap: Resolve all dependencies that the application requires to | ||
# run. | ||
|
||
set -e | ||
export PATH=/usr/share/rbenv/shims:$PATH RBENV_VERSION=$(cat .ruby-version) | ||
|
||
script/branding | ||
cd "$(dirname "$0")/.." | ||
|
||
if [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ]; then | ||
brew bundle check >/dev/null 2>&1 || { | ||
echo "==> Installing Homebrew dependencies…" | ||
brew bundle | ||
} | ||
fi | ||
|
||
if [ -f ".ruby-version" ] && [ -z "$(rbenv version-name 2>/dev/null)" ]; then | ||
echo "==> Installing Ruby…" | ||
rbenv install --skip-existing | ||
which bundle >/dev/null 2>&1 || { | ||
gem install bundler | ||
rbenv rehash | ||
} | ||
fi | ||
|
||
echo "Let's get set up here..." | ||
bundle install | ||
echo "Boom." | ||
if [ -f "Gemfile" ]; then | ||
echo "==> Installing gem dependencies…" | ||
bundle check --path vendor/gems >/dev/null 2>&1 || { | ||
bundle install --path vendor/gems --quiet --without production | ||
} | ||
fi |