From dd6fff7c961cf19e860c219d724a6cc83b681276 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erik=20Bj=C3=A4reholt?= Date: Mon, 9 Sep 2024 17:44:42 +0200 Subject: [PATCH] fix: dont crash on unknown shell syntax --- gptme/tools/shell.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/gptme/tools/shell.py b/gptme/tools/shell.py index b10bfe59..7eaafe15 100644 --- a/gptme/tools/shell.py +++ b/gptme/tools/shell.py @@ -360,12 +360,13 @@ def split_commands(script: str) -> list[str]: command_parts.append(script[start:end]) command = " ".join(command_parts) commands.append(command) - elif part.kind == "function": - commands.append(script[part.pos[0] : part.pos[1]]) - elif part.kind == "pipeline": + elif part.kind in ["function", "pipeline", "list"]: commands.append(script[part.pos[0] : part.pos[1]]) else: - logger.warning(f"Unknown shell script part of kind '{part.kind}', skipping") + logger.warning( + f"Unknown shell script part of kind '{part.kind}', hoping this works" + ) + commands.append(script[part.pos[0] : part.pos[1]]) return commands