Skip to content

fix: use extended regex in install.sh for macOS sed compatibility#25

Merged
docer1990 merged 1 commit into
mainfrom
fix/install-script-macos-java-detection
Feb 24, 2026
Merged

fix: use extended regex in install.sh for macOS sed compatibility#25
docer1990 merged 1 commit into
mainfrom
fix/install-script-macos-java-detection

Conversation

@docer1990
Copy link
Copy Markdown
Owner

Summary

  • Fix Java version detection failing on macOS despite Java 17+ being installed
  • The sed command used \? (GNU basic regex extension) which is not supported by macOS BSD sed, causing the version parsing to silently fail
  • Changed both sed calls to use -E (extended regex), which works on both macOS and Linux

Test plan

  • Run bash install.sh on macOS — should show "Java 17 found"

Copilot AI review requested due to automatic review settings February 24, 2026 13:37
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes Java version detection failing on macOS due to BSD sed incompatibility. The sed command used \? (a GNU basic regex extension) which silently fails on macOS BSD sed, causing version parsing to return empty results. The fix changes both sed calls to use -E (extended regex) with proper extended syntax, making the script portable across both macOS and Linux.

Changes:

  • Converted two sed commands from basic regex with GNU extensions to POSIX-compliant extended regex using -E flag
  • Changed \? (GNU extension) to ? and removed backslashes from parentheses to match extended regex syntax

@docer1990 docer1990 merged commit 16c29e6 into main Feb 24, 2026
7 checks passed
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.

2 participants