feat: try to find fallback conf with any name
All checks were successful
build / build (push) Successful in 1m55s
build / trigger-build-image (push) Successful in 10s

This commit is contained in:
张泊明518370910136 2025-07-01 08:39:11 -04:00
parent 8b16214be4
commit dcb2035be3
GPG Key ID: D47306D7062CDA9D

View File

@ -95,9 +95,10 @@ def convert(
app.pretty_exceptions_enable = False
logger.info(f"Converting files in {root.absolute()}")
for repo_toml_path in root.glob("**/repo.toml"):
fallback_toml_path = repo_toml_path.parent / "conf.toml"
if not fallback_toml_path.exists():
fallback_toml_path.write_text('name = "invalid commit"\n')
if not any(p != repo_toml_path for p in repo_toml_path.parent.glob("*.toml")):
fallback_toml_path = repo_toml_path.parent / "conf.toml"
if not fallback_toml_path.exists():
fallback_toml_path.write_text('name = "invalid commit"\n')
for task_toml_path in repo_toml_path.parent.glob("**/*.toml"):
if repo_toml_path == task_toml_path:
continue