Skip to content

fix: source uv environment after fresh installation in install.sh#1468

Open
Br1an67 wants to merge 1 commit intoMoonshotAI:mainfrom
Br1an67:fix/install-script-uv-path
Open

fix: source uv environment after fresh installation in install.sh#1468
Br1an67 wants to merge 1 commit intoMoonshotAI:mainfrom
Br1an67:fix/install-script-uv-path

Conversation

@Br1an67
Copy link

@Br1an67 Br1an67 commented Mar 17, 2026

Problem

After installing uv via the astral.sh installer, the current shell's PATH is not updated, causing uv not found after installation errors.

Fix

Source the uv env script (~/.local/bin/env or $CARGO_HOME/env) after installation, with a fallback to manually adding ~/.local/bin to PATH.

Fixes #1107


Open with Devin

Copy link
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 1 additional finding.

Open in Devin Review

@Br1an67 Br1an67 force-pushed the fix/install-script-uv-path branch from a57b924 to 0f583af Compare March 17, 2026 07:19
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0f583afae6

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +29 to +30
elif [ -f "${CARGO_HOME:-$HOME/.cargo}/env" ]; then
. "${CARGO_HOME:-$HOME/.cargo}/env"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Ensure ~/.local/bin fallback still runs when cargo env exists

Sourcing "${CARGO_HOME:-$HOME/.cargo}/env" in an elif branch can leave uv undiscoverable in a common setup: ~/.cargo/env exists (from rustup), but uv was just installed to ~/.local/bin and that directory is not on PATH. In that case this branch runs, the else fallback is skipped, and the script still hits Error: uv not found after installation.; I reproduced this by running the new branch logic with PATH=/usr/bin:/bin and an existing ~/.cargo/env.

Useful? React with 👍 / 👎.

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 MoonshotAI#1107
@Br1an67 Br1an67 force-pushed the fix/install-script-uv-path branch from 0f583af to 61708bb Compare March 17, 2026 07:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

安装的sh脚本有bug || The installed sh script has a bug

1 participant