fix(agents): continue rule installation after target errors

This commit is contained in:
Ryan Yin
2026-09-05 13:34:13 +08:00
parent a3bbb70508
commit 26717b613b
3 changed files with 39 additions and 5 deletions
+14 -5
View File
@@ -47,12 +47,21 @@ def main() -> int:
opencode_dir = xdg_config_home / "opencode"
claude_dir = Path("~/.claude").expanduser()
agents_dir = Path("~/.agents").expanduser()
install_one(codex_dir, agents_file, "AGENTS.md")
install_one(opencode_dir, agents_file, "AGENTS.md")
install_one(claude_dir, agents_file, "CLAUDE.md")
install_one(agents_dir, agents_file, "AGENTS.md")
targets = (
(codex_dir, "AGENTS.md"),
(opencode_dir, "AGENTS.md"),
(claude_dir, "CLAUDE.md"),
(agents_dir, "AGENTS.md"),
)
failed = False
for target_dir, target_name in targets:
try:
install_one(target_dir, agents_file, target_name)
except OSError as error:
print(f"failed {target_dir / target_name}: {error}", file=sys.stderr)
failed = True
return 0
return 1 if failed else 0
if __name__ == "__main__":