From ed4236a89c6b17acdf1973a400aa9b55903dcb58 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Thu, 23 Jul 2026 14:22:51 +0000 Subject: [PATCH] Fix remote one-line install failing under process substitution Skip local path resolution when install.sh runs via bash <(curl ...), so resolve_src falls through to cloning instead of aborting on /dev/fd. Co-authored-by: Frank Vitrano --- install.sh | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/install.sh b/install.sh index 210ce6e..f80d8d5 100644 --- a/install.sh +++ b/install.sh @@ -75,12 +75,23 @@ install_deps() { # Resolve source tree: current repo, or clone to temp resolve_src() { - local here - here=$(cd "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" && pwd) - if [[ -f $here/miaur && -d $here/lib ]]; then - SRC=$here - return 0 - fi + local src=${BASH_SOURCE[0]} + local here= + + # `bash <(curl ...)` sets BASH_SOURCE to /dev/fd/N (a pipe). readlink -f then + # yields /proc/PID/fd/pipe:..., and cd fails under set -e before we can clone. + # Only look for a local tree when the installer is a normal on-disk file. + case "$src" in + /dev/fd/* | /proc/*/fd/*) ;; + *) + if here=$(cd "$(dirname "$(readlink -f "$src")")" && pwd); then + if [[ -f $here/miaur && -d $here/lib ]]; then + SRC=$here + return 0 + fi + fi + ;; + esac echo "==> Cloning ${REPO_URL} (${BRANCH})" TMP=$(mktemp -d)