Skip to content

Instantly share code, notes, and snippets.

@Evshved
Created December 1, 2018 18:19
Show Gist options
  • Save Evshved/04f2560003cfdda6858b4bd568571c96 to your computer and use it in GitHub Desktop.
Save Evshved/04f2560003cfdda6858b4bd568571c96 to your computer and use it in GitHub Desktop.
Relaunch rails via Applescript.
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