From f26985b2c36be19487148cdd9cfc605201f78b8d Mon Sep 17 00:00:00 2001 From: Josh Flatt Date: Sat, 22 Nov 2025 20:10:53 -0600 Subject: [PATCH] added scripts and req.txt --- requirements.txt | 1 + scripts/clear_logs.sh | 21 +++++++++++++++++++++ scripts/setup_env.sh | 29 +++++++++++++++++++++++++++++ 3 files changed, 51 insertions(+) create mode 100644 requirements.txt create mode 100644 scripts/clear_logs.sh create mode 100644 scripts/setup_env.sh diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..68d357c --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +django \ No newline at end of file diff --git a/scripts/clear_logs.sh b/scripts/clear_logs.sh new file mode 100644 index 0000000..7818d5b --- /dev/null +++ b/scripts/clear_logs.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +# Define the log directory path +LOG_DIR="./resources/logs/" + +# Check if the directory exists +if [ -d "$LOG_DIR" ]; then + # If it exists, check if there are any .log files in it + if ls "$LOG_DIR"*.log 1> /dev/null 2>&1; then + # If there are log files, remove them + rm "$LOG_DIR"*.log + echo "Log files removed from $LOG_DIR." + else + # If no log files are found + echo "No log files found in $LOG_DIR." + fi +else + # If the directory does not exist, create it + mkdir "$LOG_DIR" + echo "Directory $LOG_DIR created." +fi diff --git a/scripts/setup_env.sh b/scripts/setup_env.sh new file mode 100644 index 0000000..574cc59 --- /dev/null +++ b/scripts/setup_env.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +# Exit immediately if a command exits with a non-zero status. +set -e + +# Create the virtual environment in the current directory +echo "Checking to see if virtual environment exists..." +if [ -d .venv ]; then + # echo "Virtual environment already exists. Please delete it before running this script." + # exit 1 + echo "Virtual environment already exists. Skipping creation." +else + echo "Virtual environment does not exist. Creating..." + python3.12 -m venv .venv + echo "Virtual environment created." +fi +# python -m venv .venv + +# Activate the virtual environment +source .venv/bin/activate + +# Install the required packages from the requirements.txt file +pip install -r requirements.txt + +# Upgrade pip +pip install --upgrade pip + +# Print a success message +echo "Virtual environment created and requirements installed successfully."