Created
August 10, 2011 15:14
-
-
Save tadast/1137081 to your computer and use it in GitHub Desktop.
Colorize heroku production console for Terminal on OSX
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
# Terminal, OS X (iTerm version: https://gist.github.com/1137050) | |
# 1. change 'your_app_production' to your application name | |
# 1a. Tune the colors by your taste | |
# 2. put these functions to your .bashrc, .zshrc | |
# or anywhere where it gets loaded for your iTerm session | |
# 3. restart iTerm or 'source ~/.zshrc' and use these functions | |
set_color() { | |
local R=$1 | |
local G=$2 | |
local B=$3 | |
arch -i386 /usr/bin/osascript <<EOF | |
tell application "Terminal" | |
tell window 0 | |
set the background color to {$(($R*65535/255)), $(($G*65535/255)), $(($B*65535/255))} | |
end tell | |
end tell | |
EOF | |
} | |
reset_colors() { | |
set_color 0 0 0 | |
} | |
hpp() { | |
set_color 46 0 0 | |
heroku $@ --app your_app_production #change me | |
reset_colors | |
} | |
hps() { | |
set_color 0 22 0 | |
heroku $@ --app your_app_staging #change me | |
reset_colors | |
} | |
# must have remote heroku added | |
deploy_migrate_production() { | |
git push heroku && hpp rake db:migrate && hpp restart | |
} | |
deploy_migrate_production_with_maintenance() { | |
git push production && hpp maintenance:on && hpp run rake db:migrate && hpp restart && hpp maintenance:off | |
} | |
hrk(){ | |
set_color 46 0 0 | |
heroku $@ | |
reset_colors | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment