From fde053a27e41a92e90ba5f71825bea4838351126 Mon Sep 17 00:00:00 2001 From: KaraZajac Date: Sat, 23 May 2026 00:24:58 -0400 Subject: [PATCH] install.sh: POSIX-compatible 'set -o pipefail' so 'curl | sh' works MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The README documents the one-liner as 'curl ... install.sh | sh', but on Debian/Ubuntu /bin/sh is dash which rejects 'set -o pipefail' unknown option. The shebang #!/usr/bin/env bash is honored only when the script is invoked directly — when piped via 'curl | sh' the running shell IS dash. Fix: split the strict-mode setup. 'set -eu' is POSIX-portable (every shell). 'pipefail' is then enabled conditionally only on shells that recognise it. Every curl/tar/install step in the rest of the script checks its own exit code, so losing pipefail in dash costs no behaviour — the installer still fails fast on any error. --- install.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 16afdef..2c40a27 100755 --- a/install.sh +++ b/install.sh @@ -19,7 +19,12 @@ # 0 — installed successfully # 1 — error (unsupported arch, download failure, permission denied) -set -euo pipefail +# POSIX-friendly: -eu is universal, pipefail only on shells that +# support it (bash, ksh, dash >= 0.5.12). Without pipefail the +# installer still exits on the first hard error since every curl/ +# tar/install step is checked explicitly. +set -eu +(set -o pipefail) 2>/dev/null && set -o pipefail || true REPO="${SKELETONKEY_REPO:-KaraZajac/SKELETONKEY}" VERSION="${SKELETONKEY_VERSION:-latest}"