add launcher scripts

This commit is contained in:
rambros 2026-02-24 15:08:24 +05:30
parent 248cb04cbe
commit f9782b5498
3 changed files with 72 additions and 0 deletions

34
launch-reaper-MAC.sh Normal file
View file

@ -0,0 +1,34 @@
#!/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..."
# On macOS, python3 is the standard command
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
python3 fluxer-reaper.py "$@"

38
launch-reaper-WIN.bat Normal file
View file

@ -0,0 +1,38 @@
@echo off
SET "DIR=%~dp0"
cd /d "%DIR%"
:: Check if venv exists, create it if not
if not exist "%DIR%venv" (
echo Virtual environment not found. Creating one...
python -m venv venv
if %ERRORLEVEL% neq 0 (
echo Error: Failed to create virtual environment.
pause
exit /b 1
)
:: Activate and install requirements
call venv\Scripts\activate
if exist "requirements.txt" (
echo Installing requirements...
python -m pip install --upgrade pip
pip install -r requirements.txt
) else (
echo Warning: requirements.txt not found. Skipping dependency installation.
)
) else (
:: Activate existing virtual environment
call venv\Scripts\activate
)
:: Run the application
python fluxer-reaper.py %*
if %ERRORLEVEL% neq 0 (
echo.
echo application exited with error code %ERRORLEVEL%
pause
)