Skip to content

Instantly share code, notes, and snippets.

@sebastianvera
Last active August 29, 2015 13:56
Show Gist options
  • Save sebastianvera/9300713 to your computer and use it in GitHub Desktop.
Save sebastianvera/9300713 to your computer and use it in GitHub Desktop.
#!/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