Created
December 1, 2018 18:19
-
-
Save Evshved/04f2560003cfdda6858b4bd568571c96 to your computer and use it in GitHub Desktop.
Relaunch rails via Applescript.
This file contains 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
tell application "iTerm2" | |
tell first session of first tab of first window | |
write text "Relaunching Rails application..." | |
write text "echo Kill process on 3000 port!" | |
end tell | |
tell current window | |
create tab with default profile | |
tell current session | |
write text "kill -9 $(lsof -i tcp:3000 -t)" | |
end tell | |
delay 1 | |
close current tab | |
end tell | |
tell first session of first tab of first window | |
write text "RAILS_ENV=development rails s" | |
end tell | |
end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment