From dcb2035be3e8ed679fcdfeadcad153291afbb271 Mon Sep 17 00:00:00 2001 From: Boming Zhang Date: Tue, 1 Jul 2025 08:39:11 -0400 Subject: [PATCH] feat: try to find fallback conf with any name --- joj3_config_generator/main.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/joj3_config_generator/main.py b/joj3_config_generator/main.py index 10f7f44..ebd7b0f 100644 --- a/joj3_config_generator/main.py +++ b/joj3_config_generator/main.py @@ -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