From 03aa9852700a20d34fbbb75f64693728dcde1591 Mon Sep 17 00:00:00 2001 From: sigoden Date: Sat, 17 Aug 2024 08:34:12 +0800 Subject: [PATCH] refactor: improve scripts/run-{tool,agent}.sh --- scripts/run-agent.sh | 2 +- scripts/run-tool.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/run-agent.sh b/scripts/run-agent.sh index 866b1bd..f37b43f 100755 --- a/scripts/run-agent.sh +++ b/scripts/run-agent.sh @@ -79,7 +79,7 @@ def to_args: [ to_args ] | join(" ") EOF )" - args="$(echo "$agent_data" | jq -r "$jq_script")" || { + args="$(echo "$agent_data" | jq -r "$jq_script" 2>/dev/null)" || { die "Invalid JSON data" } diff --git a/scripts/run-tool.sh b/scripts/run-tool.sh index ecbd372..bdc5547 100755 --- a/scripts/run-tool.sh +++ b/scripts/run-tool.sh @@ -76,7 +76,7 @@ def to_args: [ to_args ] | join(" ") EOF )" - args="$(echo "$tool_data" | jq -r "$jq_script")" || { + args="$(echo "$tool_data" | jq -r "$jq_script" 2>/dev/null)" || { die "Invalid JSON data" }