From 92cbd574d00ab6ea6cf5a78885b4dc8e8d9d8a47 Mon Sep 17 00:00:00 2001 From: Jerry Liu Date: Fri, 9 Feb 2024 16:43:04 -0800 Subject: [PATCH] add setup_cli.sh (oops) (#941) --- .../llama_packs/rag_cli_local/setup_cli.sh | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 llama_hub/llama_packs/rag_cli_local/setup_cli.sh diff --git a/llama_hub/llama_packs/rag_cli_local/setup_cli.sh b/llama_hub/llama_packs/rag_cli_local/setup_cli.sh new file mode 100644 index 0000000000..f6fd54e9f6 --- /dev/null +++ b/llama_hub/llama_packs/rag_cli_local/setup_cli.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +# rename this to whatever you want +CLI_NAME="lcli_local" + +# Define the path for the new command script +# RENAME lcli +COMMAND_SCRIPT="/usr/local/bin/$CLI_NAME" + +# Check if the script is run as root +if [ "$(id -u)" != "0" ]; then + echo "This script must be run as root" 1>&2 + exit 1 +fi + +# Get the full path to base.py dynamically +SCRIPT_DIR=$(pwd) +FULL_PATH_TO_BASE_PY="$SCRIPT_DIR/base.py" + +# Create the wrapper script +echo '#!/bin/bash' > "$COMMAND_SCRIPT" +echo "python $FULL_PATH_TO_BASE_PY \"\$@\"" >> "$COMMAND_SCRIPT" + +# Make the wrapper script executable +chmod +x "$COMMAND_SCRIPT" + +echo "$CLI_NAME command is now available." \ No newline at end of file