Skip to content

Teach client to find Homebrew installations on Apple Silicon - #5164

Merged
Andy Jordan (andyleejordan) merged 1 commit into
mainfrom
homebrew
Mar 26, 2025
Merged

Andy Jordan (andyleejordan) merged 1 commit into
mainfrom
homebrew

Conversation

@andyleejordan

Copy link
Copy Markdown
Member

Since /opt/homebrew is now used instead of /usr/local.

This annoyed me when setting up a new MacBook.

Copilot AI review requested due to automatic review settings March 26, 2025 20:25

Copilot AI left a comment

Copy link
Copy Markdown

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 adds support for detecting Homebrew-installed PowerShell on Apple Silicon by updating both the platform detection logic and related tests. Key changes include:

  • Defining new constants and functions to locate Homebrew installations in src/platform.ts.
  • Updating the enumeration order to search for Homebrew stable, LTS, and preview installations on macOS.
  • Enhancing tests in test/core/platform.test.ts to validate the correct discovery of Homebrew installations.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
test/core/platform.test.ts Adds test cases for Homebrew installation paths (stable, LTS, preview).
src/platform.ts Introduces constants and functions to locate Homebrew installations on macOS.
Comments suppressed due to low confidence (3)

test/core/platform.test.ts:598

  • The Homebrew stable installation path is set to "/usr/local/bin/pwsh", but on Apple Silicon it should be "/opt/homebrew/bin/pwsh". Please update this path to reflect the correct location.
{ exePath: "/usr/local/bin/pwsh", displayName: "PowerShell (Homebrew)", supportsProperArguments: true }

test/core/platform.test.ts:604

  • The Homebrew LTS installation path is set to "/usr/local/bin/pwsh-lts", but it should be "/opt/homebrew/bin/pwsh-lts" for Apple Silicon. Consider updating to the correct path.
{ exePath: "/usr/local/bin/pwsh-lts", displayName: "PowerShell LTS (Homebrew)", supportsProperArguments: true }

test/core/platform.test.ts:614

  • The Homebrew preview installation path is set to "/usr/local/bin/pwsh-preview", but it should be "/opt/homebrew/bin/pwsh-preview" for Apple Silicon. Please update this accordingly.
{ exePath: "/usr/local/bin/pwsh-preview", displayName: "PowerShell Preview (Homebrew)", supportsProperArguments: true }

@andyleejordan

Andy Jordan (andyleejordan) commented Mar 26, 2025 •

Copy link
Copy Markdown
Member Author

Yet again bit by our platform tests sharing macOS and Linux. I'm blaming Copilot for that one. The paths in the tests were right I swear, and then they were changed...

Since `/opt/homebrew` is now used instead of `/usr/local`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area-Startup Issue-Enhancement A feature request (enhancement).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants