-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
09ecda9
commit ac26ccf
Showing
2 changed files
with
63 additions
and
6 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
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 |
---|---|---|
@@ -0,0 +1,58 @@ | ||
#!/usr/bin/env bash | ||
|
||
# | ||
# Prints a log message. | ||
# | ||
function log() | ||
{ | ||
if [[ -t 1 ]]; then | ||
echo -e "\x1b[1m\x1b[32m>>>\x1b[0m \x1b[1m$1\x1b[0m" | ||
else | ||
echo ">>> $1" | ||
fi | ||
} | ||
|
||
# | ||
# Prints a warn message. | ||
# | ||
function warn() | ||
{ | ||
if [[ -t 1 ]]; then | ||
echo -e "\x1b[1m\x1b[33m***\x1b[0m \x1b[1m$1\x1b[0m" >&2 | ||
else | ||
echo "*** $1" >&2 | ||
fi | ||
} | ||
|
||
# | ||
# Prints an error message. | ||
# | ||
function error() | ||
{ | ||
if [[ -t 1 ]]; then | ||
echo -e "\x1b[1m\x1b[31m!!!\x1b[0m \x1b[1m$1\x1b[0m" >&2 | ||
else | ||
echo "!!! $1" >&2 | ||
fi | ||
} | ||
|
||
# | ||
# Prints an error message and exists with -1. | ||
# | ||
function fail() | ||
{ | ||
error "$@" | ||
exit -1 | ||
} | ||
|
||
# default to installing gems into vendor/bundle | ||
if [[ ! -f .bundle/config ]]; then | ||
bundle config set --local path vendor/bundle >/dev/null || \ | ||
fail "Failed to run 'bundle config'" | ||
fi | ||
|
||
log "Installing gems ..." | ||
bundle install || fail "Failed to run 'bundle install'!" | ||
|
||
log "Setting up the project ..." | ||
bundle exec rake setup || "Failed to run 'rake setup'!" |