Files
llm-functions/tools/execute_command.sh
sigoden 86aa910609 refactor: improve bash code (#125)
* refactor: extract guard_path to utils/guard_path.sh

* add utils/guard_operation.sh
2024-11-16 11:09:40 +08:00

17 lines
370 B
Bash
Executable File

#!/usr/bin/env bash
set -e
# @describe Execute the shell command.
# @option --command! The command to execute.
# @env LLM_OUTPUT=/dev/stdout The output path
ROOT_DIR="${LLM_ROOT_DIR:-$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)}"
main() {
"$ROOT_DIR/utils/guard_operation.sh"
eval "$argc_command" >> "$LLM_OUTPUT"
}
eval "$(argc --argc-eval "$0" "$@")"