Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
support -b
  • Loading branch information
ralsina committed May 20, 2015
1 parent 30c56a9 commit 8b59271
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions nikola/plugins/command/auto/auto.py
Expand Up @@ -34,6 +34,7 @@
from urlparse import urlparse
except ImportError:
from urllib.parse import urlparse # NOQA
import webbrowser
from wsgiref.simple_server import make_server
import wsgiref.util

Expand Down Expand Up @@ -175,6 +176,10 @@ def __call__(self, environ, start_response):
ws.initialize_websockets_manager()
print("Serving on port {0}...".format(port))

# Yes, this is racy
if browser:
webbrowser.open('http://{0}:{1}'.format(host, port))

try:
ws.serve_forever()
except KeyboardInterrupt:
Expand Down

0 comments on commit 8b59271

Please sign in to comment.