Fix one-shot auto-open url when uri-root-path is used.

This commit is contained in:
Florian Mounier
2018-09-03 11:54:38 +02:00
parent 5b6b61286d
commit 82676862ca
2 changed files with 4 additions and 3 deletions

View File

@@ -22,7 +22,6 @@ check-outdated:
ARGS ?= --port=1212 --unsecure --debug
run-debug:
sleep 0.5 && $(BROWSER) http://localhost:1212&
$(PYTHON) ./butterfly.server.py $(ARGS)
build-coffee:

View File

@@ -375,8 +375,10 @@ ioloop = tornado.ioloop.IOLoop.instance()
if port == 0:
port = list(http_server._sockets.values())[0].getsockname()[1]
url = "http%s://%s:%d/" % (
"s" if not options.unsecure else "", host, port)
url = "http%s://%s:%d/%s" % (
"s" if not options.unsecure else "", host, port,
(options.uri_root_path.strip('/') + '/') if options.uri_root_path else ''
)
if not options.one_shot or not webbrowser.open(url):
log.warn('Butterfly is ready, open your browser to: %s' % url)