fix(installer): detect piped stdin, save to file for interactive wizard
This commit is contained in:
parent
0211244076
commit
7cdff22565
2 changed files with 14 additions and 2 deletions
|
|
@ -68,8 +68,8 @@ NextWks/
|
||||||
### Production Install
|
### Production Install
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# One command — downloads, builds, deploys
|
curl -fsSL https://git.lohmar.co.uk/lexton-it/NextWks/raw/main/install.sh -o install.sh
|
||||||
curl -fsSL https://git.lohmar.co.uk/lexton-it/NextWks/raw/main/install.sh | bash
|
bash install.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
The installer walks you through:
|
The installer walks you through:
|
||||||
|
|
|
||||||
12
install.sh
12
install.sh
|
|
@ -51,6 +51,18 @@ PROXY_IP_DEFAULT="172.16.0.10"
|
||||||
# ============================================================
|
# ============================================================
|
||||||
REPO_URL="https://git.lohmar.co.uk/lexton-it/NextWks.git"
|
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
|
if [ ! -f "$REPO_DIR/src/main.go" ]; then
|
||||||
info "Cloning NextWks repository..."
|
info "Cloning NextWks repository..."
|
||||||
if ! command -v git &>/dev/null; then
|
if ! command -v git &>/dev/null; then
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue