Skip to content

Commit d17cc47

Browse files
MK8S-25: Fix create_index() to use _get_index_file_paths() directly
Complete the factorization by making create_index() consistent with clean(): - Both functions now iterate over the same _get_index_file_paths() result - Eliminates redundant directory path construction in create_index() - Uses index_file.parent.mkdir() instead of separate directory iteration - Ensures perfect consistency between creation, cleanup, and task targets
1 parent 2f36e71 commit d17cc47

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

buildchain/buildchain/targets/repository.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -280,10 +280,9 @@ def clean() -> None:
280280

281281
def create_index() -> None:
282282
"""Create empty index.html files in repository directories."""
283-
for repository_directory in self._get_repository_directories():
283+
for index_file in self._get_index_file_paths():
284284
# Create directory if it doesn't exist, then create index.html
285-
repository_directory.mkdir(parents=True, exist_ok=True)
286-
index_file = repository_directory / self.INDEX_HTML_FILENAME
285+
index_file.parent.mkdir(parents=True, exist_ok=True)
287286
index_file.touch()
288287
# Set readable permissions for nginx
289288
index_file.chmod(0o644)

0 commit comments

Comments
 (0)