Created
July 8, 2024 14:49
-
-
Save dillonhafer/043c2eaa7befe6b92dcb6205a3afdd4c to your computer and use it in GitHub Desktop.
iTerm2 script to open vite and rails server
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
#!/usr/bin/osascript | |
on run argv | |
set project to (do shell script "pwd") | |
tell application "iTerm2" | |
tell current window | |
tell current session | |
write text "clear; cd " & project | |
set serverTab to (split vertically with default profile) | |
tell serverTab to write text "cd " & project & "; (test -f config/application.rb && rails server) || exit" | |
tell serverTab | |
set viteTab to (split horizontally with default profile) | |
tell viteTab to write text "cd " & project & "; (test -f vite.config* && vite dev) || exit" | |
end tell | |
write text "code ." | |
end tell | |
end tell | |
end tell | |
end run |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment