Skip to content

Add install.sh for easy installation and recommend in README.md#384

Merged
canercidam merged 2 commits intomainfrom
caner/install-script
Feb 25, 2026
Merged

Add install.sh for easy installation and recommend in README.md#384
canercidam merged 2 commits intomainfrom
caner/install-script

Conversation

@canercidam
Copy link
Member

This PR introduces a widely known type of installation script for builder-playground and rearranges the README.md for clarity.

@canercidam canercidam merged commit 9dc55e9 into main Feb 25, 2026
@canercidam canercidam deleted the caner/install-script branch February 25, 2026 17:44
@claude
Copy link
Contributor

claude bot commented Feb 25, 2026

Claude finished @canercidam's task in 1m 17s —— View job


PR Review: Add install.sh for easy installation

  • Gather context and read changed files
  • Review install.sh
  • Review README.md changes
  • Post review feedback

Found 3 issues (1 critical bug, 1 bug, 1 improvement). Inline comments posted on the relevant lines.

Critical: grep -oP breaks on macOS (install.sh:34) — The script supports darwin but uses GNU-only Perl regex flag. BSD grep on macOS will fail. Needs a portable alternative (sed or awk).

Bug: VERSION env var doesn't propagate (README.md:28) — VERSION=1.2.3 curl ... | bash sets the var for curl, not the piped bash. Should be curl ... | VERSION=1.2.3 bash.

Improvement: Use a temp directory (install.sh:42-52) — The script downloads and extracts into the user's CWD, which can pollute the directory or fail if read-only. Using mktemp -d with a trap for cleanup would be more robust. Also, unzip availability is not checked.

fi
else
echo "Fetching latest release..."
TAG=$(curl -sSfL "$API" | grep -oP '"tag_name": "\K(.*)(?=")')
Copy link
Contributor

Choose a reason for hiding this comment

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

Bug: grep -oP uses Perl-compatible regex which is not available on macOS (BSD grep). This will fail on darwin even though the script explicitly supports it at line 11.

A portable alternative:

Suggested change
TAG=$(curl -sSfL "$API" | grep -oP '"tag_name": "\K(.*)(?=")')
TAG=$(curl -sSfL "$API" | grep '"tag_name"' | sed 's/.*"tag_name": *"\([^"]*\)".*/\1/')

Or using awk:

TAG=$(curl -sSfL "$API" | awk -F'"' '/"tag_name"/{print $4}')

curl -sSfL "$URL" -o "$ASSET"

echo "Extracting..."
unzip -o "$ASSET"
Copy link
Contributor

Choose a reason for hiding this comment

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

The script downloads and extracts into the user's current working directory. This can pollute the CWD with the zip and extracted binary, and will fail if the CWD is read-only. Consider using a temp directory:

TMP=$(mktemp -d)
trap 'rm -rf "$TMP"' EXIT

curl -sSfL "$URL" -o "$TMP/$ASSET"
unzip -o "$TMP/$ASSET" -d "$TMP"
chmod +x "$TMP/$BIN"
sudo mv "$TMP/$BIN" /usr/local/bin/

Also, unzip is not guaranteed to be installed on all systems (e.g., minimal Docker images, some Linux distros). A check or fallback to jar / python3 -m zipfile would be more robust.

If you need to install a specific version, you can use the `VERSION` env var in the beginning like:
```bash
VERSION=1.2.3 curl -sSfL https://raw.githubusercontent.com/flashbots/builder-playground/main/install.sh | bash
```
Copy link
Contributor

Choose a reason for hiding this comment

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

Bug: VERSION=1.2.3 curl ... | bash sets VERSION as an environment variable only for the curl process, not for the bash process on the right side of the pipe. The script will never see VERSION.

Should be:

Suggested change
```
curl -sSfL https://raw.githubusercontent.com/flashbots/builder-playground/main/install.sh | VERSION=1.2.3 bash

Or:

export VERSION=1.2.3 && curl -sSfL https://raw.githubusercontent.com/flashbots/builder-playground/main/install.sh | bash

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.

1 participant