Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,14 @@ success "pip3 is available"

# ensure uv
if ! command -v uv &> /dev/null; then
info "uv not found; installing via Astral.sh…"
curl -LsSf https://astral.sh/uv/install.sh | sh
export PATH="$HOME/.local/bin:$PATH"
info "uv not found; installing…"
if [[ "$OS_TYPE" == "macOS" ]]; then
brew install uv || error "Failed to install uv via Homebrew"
Copy link
Contributor

Choose a reason for hiding this comment

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

brew is invoked without first verifying that Homebrew is installed, so the script will crash with an unclear error on macOS systems that lack Homebrew. Add an explicit command -v brew check or install instructions before calling brew. (Based on your team's feedback about making setup scripts resilient to missing dependencies.)

Prompt for AI agents
Address the following comment on setup.sh at line 104:

<comment>brew is invoked without first verifying that Homebrew is installed, so the script will crash with an unclear error on macOS systems that lack Homebrew.  Add an explicit `command -v brew` check or install instructions before calling brew. (Based on your team&#39;s feedback about making setup scripts resilient to missing dependencies.)</comment>

<file context>
@@ -99,9 +99,14 @@ success &quot;pip3 is available&quot;
 
 # ensure uv
 if ! command -v uv &amp;&gt; /dev/null; then
-  info &quot;uv not found; installing via Astral.sh…&quot;
-  curl -LsSf https://astral.sh/uv/install.sh | sh
-  export PATH=&quot;$HOME/.local/bin:$PATH&quot;
+  info &quot;uv not found; installing…&quot;
+  if [[ &quot;$OS_TYPE&quot; == &quot;macOS&quot; ]]; then
+    brew install uv || error &quot;Failed to install uv via Homebrew&quot;
</file context>

else
curl -LsSf https://astral.sh/uv/install.sh | sh || error "Failed to install uv"
Copy link
Contributor

Choose a reason for hiding this comment

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

Piping a remotely fetched script directly into sh is insecure; download the installer to a file, verify its integrity, then execute it instead. (Based on previous feedback about avoiding curl | sh patterns in production scripts.)

Prompt for AI agents
Address the following comment on setup.sh at line 106:

<comment>Piping a remotely fetched script directly into `sh` is insecure; download the installer to a file, verify its integrity, then execute it instead. (Based on previous feedback about avoiding `curl | sh` patterns in production scripts.)</comment>

<file context>
@@ -99,9 +99,14 @@ success &quot;pip3 is available&quot;
 
 # ensure uv
 if ! command -v uv &amp;&gt; /dev/null; then
-  info &quot;uv not found; installing via Astral.sh…&quot;
-  curl -LsSf https://astral.sh/uv/install.sh | sh
-  export PATH=&quot;$HOME/.local/bin:$PATH&quot;
+  info &quot;uv not found; installing…&quot;
+  if [[ &quot;$OS_TYPE&quot; == &quot;macOS&quot; ]]; then
+    brew install uv || error &quot;Failed to install uv via Homebrew&quot;
</file context>

export PATH="$HOME/.local/bin:$PATH"
fi
success "uv installed"
fi
check_cmd uv
success "All prerequisites satisfied."
Expand Down