Files
loki/assets/functions/tools/execute_command.sh

18 lines
415 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
PROMPT_UTILS="${LLM_ROOT_DIR:-$(dirname "${BASH_SOURCE[0]}")/..}/functions/utils/prompt-utils.sh"
# shellcheck disable=SC1090
source "$PROMPT_UTILS"
main() {
guard_operation
# shellcheck disable=SC2154
eval "$argc_command" >> "$LLM_OUTPUT"
}