Skip to content

Commit

Permalink
Serve the correct directory when using make mode
Browse files Browse the repository at this point in the history
  • Loading branch information
AA-Turner committed Sep 18, 2024
1 parent 0f2f2f1 commit 2e9dec0
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion sphinx_autobuild/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ def main(argv=()):
out_dir = Path(args.outdir)
out_dir.mkdir(parents=True, exist_ok=True)

serve_dir = out_dir
if args.make_mode_builder:
serve_dir = out_dir / args.make_mode_builder
serve_dir.mkdir(parents=True, exist_ok=True)

host_name = args.host
port_num = args.port or find_free_port()
url_host = f"{host_name}:{port_num}"
Expand Down Expand Up @@ -72,7 +77,7 @@ def main(argv=()):
]
ignore_dirs = list(filter(None, ignore_dirs))
ignore_handler = IgnoreFilter(ignore_dirs, args.re_ignore)
app = _create_app(watch_dirs, ignore_handler, builder, out_dir, url_host)
app = _create_app(watch_dirs, ignore_handler, builder, serve_dir, url_host)

if not args.no_initial_build:
show(context="Starting initial build")
Expand Down Expand Up @@ -125,6 +130,9 @@ def _parse_args(argv):
else:
args.warnings_file = None

# Copy the make-mode builder, if present
args.make_mode_builder = sphinx_args.use_make_mode or ""

return args, build_args


Expand Down

0 comments on commit 2e9dec0

Please sign in to comment.