fix: auth-rt auto-install 使用永久路径 ~/.local/share/auth-runtime

修复之前 clone 到 /tmp 后删除导致 wrapper 指向不存在路径的问题。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
ywkj 2026-03-20 20:34:21 +08:00
parent 1884efa54e
commit 406b6d417c
1 changed files with 7 additions and 4 deletions

View File

@ -3,12 +3,15 @@ set -euo pipefail
cd "$(dirname "$0")"
# Auto-install auth-rt if not found
_AUTH_RT_SRC="$HOME/.local/share/auth-runtime"
if ! command -v auth-rt &>/dev/null && [ ! -x "$HOME/.local/bin/auth-rt" ]; then
echo "auth-rt not found, installing..."
_tmp="$(mktemp -d)"
git clone --depth 1 http://192.168.0.108:3030/agent-skills/auth-runtime.git "$_tmp/auth-runtime"
bash "$_tmp/auth-runtime/install.sh"
rm -rf "$_tmp"
if [ -d "$_AUTH_RT_SRC/.git" ]; then
git -C "$_AUTH_RT_SRC" pull --ff-only
else
git clone --depth 1 http://192.168.0.108:3030/agent-skills/auth-runtime.git "$_AUTH_RT_SRC"
fi
bash "$_AUTH_RT_SRC/install.sh"
fi
npm install