refactor: improve bash code (#125)

* refactor: extract guard_path to utils/guard_path.sh

* add utils/guard_operation.sh
This commit is contained in:
sigoden
2024-11-16 11:09:40 +08:00
committed by GitHub
parent 6d30c22b82
commit 86aa910609
17 changed files with 110 additions and 120 deletions
+2 -2
View File
@@ -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