diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..6088c22 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,8 @@ +* text=auto + +# Shell scripts must have LF line endings, even on Windows checkouts. +*.sh text eol=lf +*.command text eol=lf + +# Batch files are Windows-only. +*.bat text eol=crlf diff --git a/CHANGELOG.md b/CHANGELOG.md index 38e5312..9288ff8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ All notable changes to **Your Everyday Tools** are documented here. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project loosely follows [Semantic Versioning](https://semver.org/). +## [0.4.2] — 2026-04-20 + +### Added +- **Double-click launchers** — `run.bat` for Windows, `run.command` for macOS, and `run.sh` for Linux. Non-technical users only need to install Python once, then double-click the launcher. It auto-creates a virtual environment, installs dependencies, starts the server, and opens the browser. Close the window to stop. +- `.gitattributes` pinning LF line endings on shell/command files so the launchers work after a Windows checkout. + ## [0.4.1] — 2026-04-20 ### Fixed diff --git a/README.md b/README.md index 9c7407e..4a0dd62 100644 --- a/README.md +++ b/README.md @@ -150,11 +150,21 @@ See [CHANGELOG.md](CHANGELOG.md) for release history and recent fixes. ## Quick Start -### Prerequisites +### Easy start (recommended — no command line needed) -- **Python 3.10+** +Install [Python 3.10+](https://www.python.org/downloads/) once (on Windows, tick **"Add Python to PATH"** during install), then: -### Installation +| OS | What to do | +|----|-----------| +| **Windows** | Double-click `run.bat` | +| **macOS** | Double-click `run.command`. First time only, open Terminal in this folder and run `chmod +x run.command` (macOS strips the executable bit on downloads). | +| **Linux** | `chmod +x run.sh && ./run.sh` | + +The launcher creates a virtual environment, installs dependencies, starts the server, and opens your browser automatically. Close the window to stop. Subsequent runs skip the setup step. + +### Manual install + +If you prefer full control: ```bash # Clone the repository @@ -168,11 +178,8 @@ venv\Scripts\activate # Windows # Install dependencies pip install -r requirements.txt -``` -### Run - -```bash +# Run python app.py ``` diff --git a/run.bat b/run.bat new file mode 100644 index 0000000..27f1810 --- /dev/null +++ b/run.bat @@ -0,0 +1,57 @@ +@echo off +setlocal + +cd /d "%~dp0" + +where python >nul 2>nul +if errorlevel 1 ( + echo. + echo Python 3.10 or newer is required, but was not found on PATH. + echo. + echo Download and install it from: + echo https://www.python.org/downloads/ + echo. + echo During install, make sure to check "Add Python to PATH". + echo. + pause + exit /b 1 +) + +if not exist ".venv\Scripts\python.exe" ( + echo. + echo First-time setup: creating virtual environment... + echo (this only happens once and takes about a minute) + echo. + python -m venv .venv + if errorlevel 1 ( + echo. + echo Failed to create the virtual environment. + pause + exit /b 1 + ) +) + +call ".venv\Scripts\activate.bat" + +echo. +echo Checking dependencies... +pip install --quiet --disable-pip-version-check -r requirements.txt +if errorlevel 1 ( + echo. + echo Dependency install failed. Check your internet connection and try again. + pause + exit /b 1 +) + +echo. +echo ============================================================ +echo EveryTools is starting at http://localhost:5000 +echo Your browser will open automatically in a moment. +echo Close this window to stop the server. +echo ============================================================ +echo. + +start "" cmd /c "timeout /t 2 /nobreak >nul && start http://localhost:5000" +python app.py + +pause diff --git a/run.command b/run.command new file mode 100755 index 0000000..d63ef8a --- /dev/null +++ b/run.command @@ -0,0 +1,52 @@ +#!/usr/bin/env bash +# Double-click launcher for macOS (also works as ./run.sh on Linux). + +set -e +cd "$(dirname "$0")" + +if ! command -v python3 >/dev/null 2>&1; then + echo + echo " Python 3.10 or newer is required, but was not found." + echo + echo " macOS: brew install python (install Homebrew from https://brew.sh)" + echo " Linux: sudo apt install python3 python3-venv (Debian/Ubuntu)" + echo " sudo dnf install python3 (Fedora)" + echo + read -p "Press Enter to close..." _ + exit 1 +fi + +if [ ! -d ".venv" ]; then + echo + echo " First-time setup: creating virtual environment..." + echo " (this only happens once and takes about a minute)" + echo + python3 -m venv .venv +fi + +# shellcheck disable=SC1091 +source .venv/bin/activate + +echo +echo " Checking dependencies..." +pip install --quiet --disable-pip-version-check -r requirements.txt + +echo +echo " ============================================================" +echo " EveryTools is starting at http://localhost:5000" +echo " Your browser will open automatically in a moment." +echo " Press Ctrl+C in this window to stop the server." +echo " ============================================================" +echo + +# Open the browser after a brief delay, in the background. +( + sleep 2 + if command -v open >/dev/null 2>&1; then + open http://localhost:5000 + elif command -v xdg-open >/dev/null 2>&1; then + xdg-open http://localhost:5000 + fi +) & + +python app.py diff --git a/run.sh b/run.sh new file mode 100755 index 0000000..4676be8 --- /dev/null +++ b/run.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash +# Launcher for Linux. Run with: ./run.sh +# (macOS users: use run.command — identical content, different filename +# so Finder recognises it as double-clickable.) + +exec "$(dirname "$0")/run.command" "$@"