Skip to content

Commit

Permalink
Better Address Notification
Browse files Browse the repository at this point in the history
Returns a full URL path as well as the host and port to use.

Fixes #1
  • Loading branch information
spjmurray committed Sep 26, 2018
1 parent 47ab34f commit aca157b
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/run
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,15 @@ def init_repo(args):
os.chdir(ANTORA_HOME + '/' + BASE_REPO)
Executor.execute(['antora', PLAYBOOK])

# Calculate the URL to report back to the user
with open(MODULE_REPO_PATH + args.path + '/antora.yml') as filedesc:
module = yaml.load(filedesc.read())

page, _ = os.path.splitext(module['start_page'].split(':')[1])
url = module['name'] + '/' + module['version'] + '/' + page + '.html'

logging.info('Serving content on http://localhost:8080/%s', url)


def init_httpd():
"""Start the HTTP daemon when the vhost directory is created"""
Expand All @@ -104,7 +113,7 @@ def init_httpd():
def init_slumber():
"""Sleep until we are killed"""

logging.info('Serving content on http://localhost:8080, press Ctl+C to exit ...')
logging.info('Press Ctl+C to exit ...')
while True:
time.sleep(10)

Expand Down

0 comments on commit aca157b

Please sign in to comment.