Skip to content

Instantly share code, notes, and snippets.

@rondale-sc
Created November 13, 2012 16:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save rondale-sc/4066982 to your computer and use it in GitHub Desktop.
Save rondale-sc/4066982 to your computer and use it in GitHub Desktop.
set project_directory to do shell script "find ~/ ~/dev ~/dev/ruby ~/dev/rails -maxdepth 1 -type d -name " & q & " | head -1"
on pathexists(path)
try
POSIX file 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 session and start Vim.
tell (make new session at the end of sessions)
exec command "/bin/zsh"
write text "cd " & project_directory
write text "vim"
end tell
-- 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
end tell
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment