Last active
August 29, 2015 14:09
-
-
Save typeoneerror/3ae9fa830be48544ae68 to your computer and use it in GitHub Desktop.
run all the things
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
#!/bin/bash | |
# backend/run | |
echo -n -e "\033]0;Rails\007" | |
foreman start | |
echo -n -e "\033]0;\007" |
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
#!/bin/bash | |
# frontend/run | |
echo -n -e "\033]0;Ember\007"; | |
ember server --proxy http://localhost:3000/ | |
echo -n -e "\033]0;\007"; |
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
#!/bin/bash | |
path="$( cd "$(dirname $( dirname "$0" ))" && pwd )"; | |
# function to open a new terminal tab and run commands (for Apple Terminal or iTerm) | |
open_tab() { | |
[ $# -lt 1 ] && return | |
if [ "$TERM_PROGRAM" == "Apple_Terminal" ] | |
then | |
osascript -e " | |
tell application \"System Events\" to tell process \"Terminal\" to keystroke \"t\" using command down | |
tell application \"Terminal\" to do script \"$1\" in selected tab of the front window | |
" > /dev/null 2>&1 | |
fi | |
if [ "$TERM_PROGRAM" == "iTerm.app" ] | |
then | |
osascript -e " | |
tell application \"System Events\" to tell process \"Terminal\" to keystroke \"t\" using command down | |
tell application \"iTerm\" | |
activate | |
set _session to current session of current terminal | |
tell _session | |
write text \"$1\" | |
end tell | |
end tell | |
" | |
fi | |
} | |
# run ember front end in new tab | |
open_tab "cd $path; cd ./frontend; ./run-frontend.sh"; | |
# run api and web server in new tab | |
open_tab "cd $path; cd ./backend; ./run-backend.sh" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment