From 97f4bc8104f144be39b7d3c558d4d2a0fb0a5f2d Mon Sep 17 00:00:00 2001 From: hteppl Date: Fri, 6 Dec 2024 18:39:35 +0300 Subject: [PATCH] Add linux shell scripts to configure dependencies automatically --- install.sh | 23 +++++++++++++++++++++++ start.sh | 11 +++++++++++ 2 files changed, 34 insertions(+) create mode 100644 install.sh create mode 100644 start.sh diff --git a/install.sh b/install.sh new file mode 100644 index 00000000..1ed1a504 --- /dev/null +++ b/install.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +# Check if the virtual environment directory exists +if [ ! -d "venv" ]; then + echo "Creating virtual environment..." + python3 -m venv venv +fi + +# Activate the virtual environment +source venv/bin/activate + +# Install dependencies if they haven't been installed yet +if [ ! -f "venv/lib/python*/site-packages/installed" ]; then + echo "Installing wheel for faster installing..." + pip3 install wheel + + echo "Installing dependencies..." + if [ -f "requirements.txt" ]; then + pip3 install -r requirements.txt + fi +fi + +echo "Installation completed successfully!" diff --git a/start.sh b/start.sh new file mode 100644 index 00000000..64550735 --- /dev/null +++ b/start.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +# Activate the virtual environment +source venv/bin/activate + +# Start the bot +echo "Starting the bot..." +python3 main.py + +# Deactivate the virtual environment when done +deactivate