Skip to content

Commit

Permalink
🐛(ozi-new): create an appropriate symlink for GitHub README rendering…
Browse files Browse the repository at this point in the history
… to work

Signed-off-by: rjdbcm <[email protected]>
  • Loading branch information
rjdbcm committed Jun 10, 2024
1 parent 38e6785 commit 44d2033
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions ozi/fix/build_definition.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ def process(
file
for file in os.listdir(target / rel_path)
if os.path.isfile(target / rel_path / file)
and not os.path.islink(target / rel_path / file)
]
found_files = found_files if found_files else []
extra_files = list(set(extra_files).symmetric_difference(set(found_files)))
Expand Down
7 changes: 6 additions & 1 deletion ozi/new/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"""ozi-new entrypoint script."""
from __future__ import annotations

import os
import re
from pathlib import Path
from typing import TYPE_CHECKING
Expand Down Expand Up @@ -44,7 +45,11 @@ def create_project_files(
project.allow_file = set(map(Path, project.allow_file))
project.ci_user = render_ci_files_set_user(env, project.target, project.ci_provider)
render_project_files(env, project.target, project.name)

if project.ci_provider == 'github':
Path(
project.target,
f'README.{project.readme_type}',
).symlink_to(Path(project.target, 'README'))

def _valid_project(project: Namespace) -> Namespace:
"""Validate a project namespace."""
Expand Down

0 comments on commit 44d2033

Please sign in to comment.