Skip to content

Commit 61708bb

Browse files
committed
fix: source uv environment after fresh installation in install.sh
After installing uv via the astral.sh installer, the current shell's PATH is not updated, causing 'uv not found' errors. Source the uv env script (or fall back to adding ~/.local/bin to PATH) after installation so subsequent commands can find uv. Fixes #1107
1 parent 7ba9695 commit 61708bb

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

scripts/install.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,22 @@ if command -v uv >/dev/null 2>&1; then
2020
UV_BIN="uv"
2121
else
2222
install_uv
23+
24+
# The uv installer adds itself to ~/.local/bin (or $CARGO_HOME/bin)
25+
# but doesn't update the current shell's PATH. Source all available
26+
# env scripts and ensure the default location is on PATH.
27+
if [ -f "$HOME/.local/bin/env" ]; then
28+
. "$HOME/.local/bin/env"
29+
fi
30+
if [ -f "${CARGO_HOME:-$HOME/.cargo}/env" ]; then
31+
. "${CARGO_HOME:-$HOME/.cargo}/env"
32+
fi
33+
# Always add ~/.local/bin as fallback in case env scripts don't cover it
34+
case ":$PATH:" in
35+
*":$HOME/.local/bin:"*) ;;
36+
*) export PATH="$HOME/.local/bin:$PATH" ;;
37+
esac
38+
2339
UV_BIN="uv"
2440
fi
2541

0 commit comments

Comments
 (0)