fix(installer): detect piped stdin, save to file for interactive wizard

This commit is contained in:
Claus Lohmar 2026-06-14 15:57:08 +00:00
parent 0211244076
commit 7cdff22565
2 changed files with 14 additions and 2 deletions

View file

@ -68,8 +68,8 @@ NextWks/
### Production Install
```bash
# One command — downloads, builds, deploys
curl -fsSL https://git.lohmar.co.uk/lexton-it/NextWks/raw/main/install.sh | bash
curl -fsSL https://git.lohmar.co.uk/lexton-it/NextWks/raw/main/install.sh -o install.sh
bash install.sh
```
The installer walks you through:

View file

@ -51,6 +51,18 @@ PROXY_IP_DEFAULT="172.16.0.10"
# ============================================================
REPO_URL="https://git.lohmar.co.uk/lexton-it/NextWks.git"
# Detect if stdin is piped (curl|bash) — save to file and re-exec
if [ ! -t 0 ] && [ -z "${NEXTWKS_REEXEC:-}" ]; then
SCRIPT_FILE="/tmp/nextwks-install.sh"
cat > "$SCRIPT_FILE"
chmod +x "$SCRIPT_FILE"
echo ""
echo "Script saved to $SCRIPT_FILE"
echo "Run: bash $SCRIPT_FILE"
echo ""
exit 0
fi
if [ ! -f "$REPO_DIR/src/main.go" ]; then
info "Cloning NextWks repository..."
if ! command -v git &>/dev/null; then