diff options
Diffstat (limited to 'run/tool.sh')
| -rwxr-xr-x | run/tool.sh | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/run/tool.sh b/run/tool.sh index 4846c8e..faafddd 100755 --- a/run/tool.sh +++ b/run/tool.sh @@ -1,6 +1,12 @@ #!/usr/bin/env bash set -e +export LLM_FUNCTIONS_DIR="$(cd -- "$( dirname -- "${BASH_SOURCE[0]}" )/.." &> /dev/null && pwd)" + +if [[ -f "$LLM_FUNCTIONS_DIR/.env" ]]; then + source "$LLM_FUNCTIONS_DIR/.env" +fi + if [[ "$0" == *tool.sh ]]; then FUNC_FILE="$1" FUNC_DATA="$2" @@ -12,8 +18,7 @@ if [[ "$FUNC_FILE" != *'.sh' ]]; then FUNC_FILE="$FUNC_FILE.sh" fi -PROJECT_DIR="$(cd -- "$( dirname -- "${BASH_SOURCE[0]}" )/.." &> /dev/null && pwd)" -FUNC_FILE="$PROJECT_DIR/tools/$FUNC_FILE" +FUNC_FILE="$LLM_FUNCTIONS_DIR/tools/$FUNC_FILE" if [[ "$OS" == "Windows_NT" ]]; then FUNC_FILE="$(cygpath -w "$FUNC_FILE")" |
