Created
September 12, 2010 21:43
-
-
Save dennisreimann/576486 to your computer and use it in GitHub Desktop.
shell-script for opening several terminal tabs for a rails project
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
#!/bin/bash | |
if [ $# -ne 1 ]; then PATHDIR=`pwd`; else PATHDIR=~/Sites/"$1"; fi | |
/usr/bin/osascript <<EOF | |
set actions to {"./script/server", "bundle exec spork rspec", "bundle exec autospec", "git pull --rebase && mate ."} | |
on new_tab() | |
tell application "System Events" to tell process "Terminal" \ | |
to keystroke "t" using command down | |
end new_tab | |
tell application "Terminal" | |
repeat with action in actions | |
do script with command "cd $PATHDIR && " & action \ | |
in selected tab of the front window | |
if action contains "spork" then | |
delay 3 | |
end if | |
my new_tab() | |
end repeat | |
end tell | |
EOF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment