aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorsigoden <sigoden@gmail.com>2024-11-16 11:09:40 +0800
committerGitHub <noreply@github.com>2024-11-16 11:09:40 +0800
commit86aa9106090a0219bac30bc12f5a5bd91949afd9 (patch)
tree69aef8c03242c67480c4edfe42a2cbf4c785b466 /scripts
parent6d30c22b82a5ac1a5775d8137c3b08a581770273 (diff)
downloadllm-functions-docker-86aa9106090a0219bac30bc12f5a5bd91949afd9.tar.gz
refactor: improve bash code (#125)
* refactor: extract guard_path to utils/guard_path.sh * add utils/guard_operation.sh
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/declarations-util.sh2
-rwxr-xr-xscripts/run-agent.sh4
-rwxr-xr-xscripts/run-tool.sh4
3 files changed, 5 insertions, 5 deletions
diff --git a/scripts/declarations-util.sh b/scripts/declarations-util.sh
index 4ee5ca8..d82f4b4 100755
--- a/scripts/declarations-util.sh
+++ b/scripts/declarations-util.sh
@@ -63,7 +63,7 @@ end
fi
fi
if [[ -z "$json_type" ]]; then
- echo "invalid JSON data"
+ echo "error: invalid JSON data" >&2
exit 1
fi
}
diff --git a/scripts/run-agent.sh b/scripts/run-agent.sh
index 0b6ed47..dc11e58 100755
--- a/scripts/run-agent.sh
+++ b/scripts/run-agent.sh
@@ -53,7 +53,7 @@ load_env() {
run() {
if [[ -z "$agent_data" ]]; then
- die "No JSON data"
+ die "error: no JSON data"
fi
if [[ "$OS" == "Windows_NT" ]]; then
@@ -81,7 +81,7 @@ def to_args:
EOF
)"
args="$(echo "$agent_data" | jq -r "$jq_script" 2>/dev/null)" || {
- die "Invalid JSON data"
+ die "error: invalid JSON data"
}
no_llm_output=0
diff --git a/scripts/run-tool.sh b/scripts/run-tool.sh
index 4ede4a1..a87c762 100755
--- a/scripts/run-tool.sh
+++ b/scripts/run-tool.sh
@@ -49,7 +49,7 @@ load_env() {
run() {
if [[ -z "$tool_data" ]]; then
- die "No JSON data"
+ die "error: no JSON data"
fi
if [[ "$OS" == "Windows_NT" ]]; then
@@ -77,7 +77,7 @@ def to_args:
EOF
)"
args="$(echo "$tool_data" | jq -r "$jq_script" 2>/dev/null)" || {
- die "Invalid JSON data"
+ die "error: invalid JSON data"
}
no_llm_output=0