Skip to content

Instantly share code, notes, and snippets.

@dennisreimann
Created September 12, 2010 21:43
Show Gist options
  • Save dennisreimann/576486 to your computer and use it in GitHub Desktop.
Save dennisreimann/576486 to your computer and use it in GitHub Desktop.
shell-script for opening several terminal tabs for a rails project
#!/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