diff --git a/README.md b/README.md index e6e4075..a940e6d 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ ## Quick install ```bash -bash <(curl -fsSL https://raw.githubusercontent.com/outis1one/openwhispr-easy-setup/main/setup-openwhispr.sh) +curl -fsSL https://raw.githubusercontent.com/outis1one/openwhispr-easy-setup/main/setup-openwhispr.sh -o /tmp/setup-openwhispr.sh && bash /tmp/setup-openwhispr.sh ``` Or clone and run: diff --git a/setup-openwhispr.sh b/setup-openwhispr.sh index af3e367..d65c627 100755 --- a/setup-openwhispr.sh +++ b/setup-openwhispr.sh @@ -3,6 +3,14 @@ # https://github.com/outis1one/openwhispr-easy-setup # License: MIT +# ── Wrap everything in main() so bash reads the entire script before executing. +# This prevents the "line-by-line interpreted as commands" bug when run via: +# bash <(curl -fsSL ...) or curl ... | bash +# Without this wrapper, bash may lose track of the script source after a read +# from /dev/tty and start feeding remaining script lines to the shell prompt. + +main() { + # Do NOT use set -e — we handle errors explicitly readonly SCRIPT_VERSION="1.0.0" @@ -653,3 +661,8 @@ cat <