mirror of
https://codeberg.org/listyantidewi/your-everyday-tools.git
synced 2026-07-01 23:17:37 +08:00
added launcher script
This commit is contained in:
@@ -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
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
```
|
||||
|
||||
|
||||
@@ -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
|
||||
Executable
+52
@@ -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
|
||||
Reference in New Issue
Block a user