diff --git a/scripts/install.sh b/scripts/install.sh index 0e392ffec..665cf8882 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -4,16 +4,25 @@ set -euo pipefail install_uv() { if command -v curl >/dev/null 2>&1; then curl -fsSL https://astral.sh/uv/install.sh | sh - return - fi - - if command -v wget >/dev/null 2>&1; then + elif command -v wget >/dev/null 2>&1; then wget -qO- https://astral.sh/uv/install.sh | sh - return + else + echo "Error: curl or wget is required to install uv." >&2 + exit 1 fi - echo "Error: curl or wget is required to install uv." >&2 - exit 1 + # The upstream uv installer writes ${XDG_BIN_HOME:-$HOME/.local/bin}/env and + # prints "Run 'source ...' to add uv to your PATH" — but it does not source + # the file itself. Source it here so the rest of THIS script (and the user's + # immediate `kimi` invocation) can find uv on PATH. + uv_env="${XDG_BIN_HOME:-$HOME/.local/bin}/env" + if [ -f "$uv_env" ]; then + # shellcheck disable=SC1090 + . "$uv_env" + else + # Fallback for older uv installers that may not write an env script. + export PATH="${XDG_BIN_HOME:-$HOME/.local/bin}:$PATH" + fi } if command -v uv >/dev/null 2>&1; then