disco-reaper/launch-reaper-LINUX.sh
2026-03-02 23:14:43 +05:30

43 lines
1.2 KiB
Bash
Executable file

#!/bin/bash
# Get the directory where the script is located
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
cd "$DIR"
# Check if venv exists, create it if not
if [ ! -d "$DIR/venv" ]; then
echo "Virtual environment not found. Creating one..."
python3 -m venv "$DIR/venv"
if [ $? -ne 0 ]; then
echo "Error: Failed to create virtual environment."
exit 1
fi
# Activate and install requirements
source "$DIR/venv/bin/activate"
if [ -f "$DIR/requirements.txt" ]; then
echo "Installing requirements..."
pip install --upgrade pip
pip install -r "$DIR/requirements.txt"
else
echo "Warning: requirements.txt not found. Skipping dependency installation."
fi
else
# Activate existing virtual environment
source "$DIR/venv/bin/activate"
fi
# Run the application
if [[ "$1" == "--cli" ]]; then
echo "Starting Disco Reaper in CLI mode..."
python3 disco-reaper.py --cli
elif [[ "$1" == "--tui" ]]; then
echo "Starting Disco Reaper in TUI mode..."
python3 disco-reaper.py --tui
else
# Default to TUI if no arguments or other arguments
echo "Starting Disco Reaper (Default: TUI)..."
python3 disco-reaper.py --tui "$@"
fi