Skip to content

Commit 4ba29dd

Browse files
fix: move delete_placeholder_index_md_files back to postbuild
1 parent c0cce94 commit 4ba29dd

2 files changed

Lines changed: 1 addition & 11 deletions

File tree

src/afterpython/cli/commands/build.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -171,13 +171,7 @@ def _move_files(
171171
print(f"Moved: {source} to {destination}")
172172

173173
build_content_json()
174-
# In dev mode the MyST `start` server is watching these files. Deleting
175-
# them here would make MyST re-index without the placeholder and revert
176-
# to using the first content file as the section index — exactly what
177-
# the placeholder was created to prevent. `ap dev` cleans them up in
178-
# its `finally` block after MyST has been shut down.
179-
if not dev_build:
180-
delete_placeholder_index_md_files()
174+
delete_placeholder_index_md_files()
181175

182176
website_static = ap.paths.website_path / "static"
183177
website_static.mkdir(parents=True, exist_ok=True)

src/afterpython/cli/commands/dev.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
import click
1212
from click.exceptions import Exit
1313

14-
from afterpython.builders import delete_placeholder_index_md_files
1514
from afterpython.cli.commands.build import postbuild, prebuild
1615
from afterpython.const import CONTENT_TYPES
1716
from afterpython.utils import find_available_port, find_node_env
@@ -219,6 +218,3 @@ def cleanup_processes():
219218
pass
220219
finally:
221220
cleanup_processes()
222-
# Now that MyST watchers are gone, clean up the placeholders
223-
# postbuild() intentionally left behind for dev mode.
224-
delete_placeholder_index_md_files()

0 commit comments

Comments
 (0)