Skip to content

Commit a57b924

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 94212ea commit a57b924

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

scripts/install.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,18 @@ 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 the env script
26+
# if available, otherwise add the default location to PATH.
27+
if [ -f "$HOME/.local/bin/env" ]; then
28+
. "$HOME/.local/bin/env"
29+
elif [ -f "${CARGO_HOME:-$HOME/.cargo}/env" ]; then
30+
. "${CARGO_HOME:-$HOME/.cargo}/env"
31+
else
32+
export PATH="$HOME/.local/bin:$PATH"
33+
fi
34+
2335
UV_BIN="uv"
2436
fi
2537

0 commit comments

Comments
 (0)