Created
July 30, 2013 00:27
-
-
Save oaltman/6109099 to your computer and use it in GitHub Desktop.
Alias .
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
function .() { | |
set +o monitor | |
PORT=8888 | |
ADDRESS='localhost' | |
BROWSER="chromium-browser" | |
[[ -n "$1" ]] && PORT=$1 | |
[[ -n "$2" ]] && ADDRESS=$2 | |
[[ -n "$3" ]] && BROWSER=$3 | |
CURRENT=`pwd` | |
[[ ! -f "index.php" ]] && cd www | |
nohup php -S "$ADDRESS:$PORT" & | |
SERVER_PID=$! | |
echo $PID | |
cd $CURRENT | |
nohup $BROWSER --app="http://$ADDRESS:$PORT/?LR-verbose" & | |
BROWSER_PID=$! | |
echo $BROWSER_PID | |
[[ -f "Guardfile" ]] && guard start -c -i && read | |
[[ ! -f "Guardfile" ]] && read | |
kill -9 `pgrep -P $$` | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment