From 392a42d2ef45fb6bede8827612148e1f3598b92e Mon Sep 17 00:00:00 2001 From: Jerry Chae Date: Wed, 13 May 2026 16:24:33 +0900 Subject: [PATCH] =?UTF-8?q?pi=20=EC=84=A4=EC=B9=98=20=ED=9B=84=20=EC=84=A4?= =?UTF-8?q?=EC=B9=98=20=EC=9C=84=EC=B9=98=EB=A5=BC=20=EB=AA=BB=20=EC=B0=BE?= =?UTF-8?q?=EC=95=84=20=EB=AC=B8=EC=A0=9C=20=EB=B0=9C=EC=83=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install-pi.sh | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/install-pi.sh b/install-pi.sh index da80d37..a2b0d88 100755 --- a/install-pi.sh +++ b/install-pi.sh @@ -104,9 +104,11 @@ if command -v pi &>/dev/null; then PI_BIN="$(command -v pi)" fi -# 2) Try expanding common locations where npm/pip install globally +# 2) Try expanding common locations where npm/pip/curl-installer place the binary +# pi-node uses versioned dirs like node-v22.22.2-linux-x64, so we glob for any subdir if [ -z "$PI_BIN" ]; then for candidate in \ + "$HOME/.local/share/pi-node/current/bin/pi" \ "$HOME/.local/bin/pi" \ "$HOME/.npm/bin/pi" \ "/usr/local/bin/pi" \ @@ -117,6 +119,17 @@ if [ -z "$PI_BIN" ]; then break fi done + + # Glob for pi-node versioned installs (e.g. ~/.local/share/pi-node/node-v22.22.2-linux-x64/bin/pi) + if [ -z "$PI_BIN" ]; then + _latest_pi_node="$HOME/.local/share/pi-node" + if [ -d "$_latest_pi_node" ]; then + _pi_node_bin="$(find "$_latest_pi_node" -name pi -path '*/bin/pi' -type f 2>/dev/null | head -1)" + if [ -n "$_pi_node_bin" ] && [ -x "$_pi_node_bin" ]; then + PI_BIN="$_pi_node_bin" + fi + fi + fi fi # 3) Try npm prefix to locate the global bin