Skip to content

Commit

Permalink
Add option not to start browser window to start.sh (oppia#6363)
Browse files Browse the repository at this point in the history
* add option not to start browser window

* remove mistake webpack line

* remove webpack

* add gulp back
  • Loading branch information
vojtechjelinek authored and apb7 committed Mar 20, 2019
1 parent 5242c2a commit 7f6e1d4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions scripts/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ ENABLE_CONSOLE_ARG=""

# Argument passed to feconf.py to help choose production templates folder.
FORCE_PROD_MODE=False
START_BROWSER=True
for arg in "$@"; do
if [ "$arg" == "--save_datastore" ]; then
CLEAR_DATASTORE_ARG=""
Expand All @@ -79,6 +80,9 @@ for arg in "$@"; do
if [ "$arg" == "--prod_env" ]; then
FORCE_PROD_MODE=True
fi
if [ "$arg" == "--no-browser" ]; then
START_BROWSER=False
fi
done

if [[ "$FORCE_PROD_MODE" == "True" ]]; then
Expand Down Expand Up @@ -110,7 +114,7 @@ fi
while ! nc -vz localhost 8181 >/dev/null 2>&1; do sleep 1; done

# Launch a browser window.
if [ ${OS} == "Linux" ]; then
if [ ${OS} == "Linux" ] && [ "$START_BROWSER" == "True" ]; then
detect_virtualbox="$(ls -1 /dev/disk/by-id/)"
if [[ $detect_virtualbox = *"VBOX"* ]]; then
echo ""
Expand All @@ -126,7 +130,7 @@ if [ ${OS} == "Linux" ]; then
echo ""
(sleep 5; xdg-open http://localhost:8181/ )&
fi
elif [ ${OS} == "Darwin" ]; then
elif [ ${OS} == "Darwin" ] && [ "$START_BROWSER" == "True" ]; then
echo ""
echo " INFORMATION"
echo " Setting up a local development server at localhost:8181. Opening a"
Expand Down

0 comments on commit 7f6e1d4

Please sign in to comment.