Skip to content
This repository has been archived by the owner on Apr 15, 2023. It is now read-only.

Commit

Permalink
Improve checks in bin/setup
Browse files Browse the repository at this point in the history
  • Loading branch information
practicingruby committed Feb 26, 2014
1 parent 482ea03 commit 852b80a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions bin/setup
Expand Up @@ -10,6 +10,10 @@ has_ruby() {
command_exists "ruby" && ruby -v | grep -q "$1"
}

has_qmake() {
command_exists "qmake" && qmake -v | grep -q "$1"
}

error_title() {
echo "\033[31m == $1 ==\033[0m"
}
Expand All @@ -19,7 +23,7 @@ link() {
}

# Check for qmake
if ! command_exists "qmake"; then
if ! has_qmake "4.8"; then
exec >&2
error_title "We use capybara-webkit for testing our app"
echo "capybara-webkit depends on a WebKit implementation from Qt."
Expand All @@ -42,7 +46,7 @@ if ! command_exists "psql"; then
fi

# Check Ruby 2.0 is installed.
if ! has_ruby "2.0"; then
if ! has_ruby "2.*"; then
exec >&2
error_title "The application runs on Ruby 2.0"
echo "In order to get the app running, you first need to install Ruby 2.0."
Expand Down

0 comments on commit 852b80a

Please sign in to comment.