Created
November 13, 2012 16:58
-
-
Save rondale-sc/4066982 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
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