Last active
August 29, 2015 13:56
-
-
Save sebastianvera/9300713 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#!/bin/sh | |
diff=`git diff --name-only HEAD@{1} HEAD` | |
migrate=`expr "$diff" : ".*db/migrate.*"` | |
bundle=`expr "$diff" : ".*Gemfile*"` | |
app_name=`basename $PWD` | |
if [ ! "$bundle" -eq 0 ] | |
then | |
title='Bundle needed!' | |
message="You should run 'bundle install'" | |
# osascript -e 'display notification "'"$message"'" with title "'"$title"'" subtitle "'$app_name'"' | |
command -v terminal-notifier > /dev/null && terminal-notifier -title "🚨 $title" -message "$message" -subtitle "$app_name" -sound "default" | |
fi | |
if [ ! "$migrate" -eq 0 ] | |
then | |
title='Migration needed!' | |
message="You should run 'rake db:migrate'" | |
# osascript -e 'display notification "'"$message"'" with title "'"$title"'" subtitle "'$app_name'"' | |
command -v terminal-notifier > /dev/null && terminal-notifier -title "🚨 $title" -message "$message" -subtitle "$app_name" -sound "default" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment