diff --git a/README.md b/README.md index 4c0137b..23653d9 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ ## 🚀 One-Command Install ```bash -sudo bash -c "$(curl -fsSL https://git.lohmar.co.uk/cclohmar/ReceiptNext/raw/branch/main/install.sh)" +bash -c "$(curl -fsSL https://git.lohmar.co.uk/cclohmar/ReceiptNext/raw/branch/main/install.sh)" ``` Or from a local clone: diff --git a/install.sh b/install.sh index 38c368b..d963e43 100755 --- a/install.sh +++ b/install.sh @@ -126,6 +126,10 @@ esac if command -v go &>/dev/null; then info "Building binary from source (pure Go, no CGO)..." + # Use a writable module cache — the user's home may not be writable + export GOMODCACHE="${INSTALL_DIR}/.go/mod" + export GOPATH="${INSTALL_DIR}/.go" + mkdir -p "${GOMODCACHE}" 2>/dev/null || sudo_if mkdir -p "${GOMODCACHE}" CGO_ENABLED=0 go build -ldflags="-s -w" -o app . else info "Go not found — downloading pre-built binary..."