-
-
Save rwjblue/4075959 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 ~/ ~/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