Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
set project_directory to do shell script "find ~/ ~/Source ~/Source/ruby ~/Source/ruby/webapps -maxdepth 1 -type d -name " & q & " | head -1"
on pathexists(path)
try
path as alias
return true
on error
return false
end try
end pathexists
tell application "iTerm"
activate
set myterm to (make new terminal)
tell myterm
-- Create New window and start Zeus if zeus.json exists
if my pathexists(project_directory & "/zeus.json") then
tell (launch session "Default")
write text "cd " & project_directory
write text "zeus start"
end tell
end if
-- Create new session and start Guard if Guardfile exists.
if my pathexists(project_directory & "/Guardfile") then
tell (launch session "Default")
write text "cd " & project_directory
write text "guard"
end tell
end if
-- Create new session and start Vim.
tell (launch session "Default")
write text "cd " & project_directory
write text "vim"
end tell
-- Create new session and do git status.
tell (launch session "Default")
write text "cd " & project_directory
write text "git status"
end tell
end tell
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment