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