diff --git a/launcher.sh b/launch-reaper-LINUX.sh similarity index 100% rename from launcher.sh rename to launch-reaper-LINUX.sh diff --git a/launch-reaper-MAC.sh b/launch-reaper-MAC.sh new file mode 100644 index 0000000..9770f54 --- /dev/null +++ b/launch-reaper-MAC.sh @@ -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 "$@" diff --git a/launch-reaper-WIN.bat b/launch-reaper-WIN.bat new file mode 100644 index 0000000..22a31aa --- /dev/null +++ b/launch-reaper-WIN.bat @@ -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 +)