From 7cdff22565580187c45434d4927db3dcbe5e0b85 Mon Sep 17 00:00:00 2001 From: cclohmar Date: Sun, 14 Jun 2026 15:57:08 +0000 Subject: [PATCH] fix(installer): detect piped stdin, save to file for interactive wizard --- README.md | 4 ++-- install.sh | 12 ++++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6c242b5..20c2944 100644 --- a/README.md +++ b/README.md @@ -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: diff --git a/install.sh b/install.sh index d1047d1..2c7aea6 100755 --- a/install.sh +++ b/install.sh @@ -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