Merge pull request #1

Fix remote one-line install failing under process substitution
This commit is contained in:
Frank Vitrano
2026-07-23 22:27:09 +08:00
committed by GitHub
+13 -2
View File
@@ -75,12 +75,23 @@ install_deps() {
# Resolve source tree: current repo, or clone to temp # Resolve source tree: current repo, or clone to temp
resolve_src() { resolve_src() {
local here local src=${BASH_SOURCE[0]}
here=$(cd "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" && pwd) 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 if [[ -f $here/miaur && -d $here/lib ]]; then
SRC=$here SRC=$here
return 0 return 0
fi fi
fi
;;
esac
echo "==> Cloning ${REPO_URL} (${BRANCH})" echo "==> Cloning ${REPO_URL} (${BRANCH})"
TMP=$(mktemp -d) TMP=$(mktemp -d)