Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Teach client to find Homebrew installations on Apple Silicon#5164

Merged
andyleejordan merged 1 commit into
mainPowerShell/vscode-powershell:mainfrom
homebrewPowerShell/vscode-powershell:homebrewCopy head branch name to clipboard
Mar 26, 2025
Merged

Teach client to find Homebrew installations on Apple Silicon#5164
andyleejordan merged 1 commit into
mainPowerShell/vscode-powershell:mainfrom
homebrewPowerShell/vscode-powershell:homebrewCopy head branch name to clipboard

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.

@andyleejordan andyleejordan added Issue-Enhancement A feature request (enhancement). Area-Startup labels Mar 26, 2025
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

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`.
@andyleejordan andyleejordan enabled auto-merge (squash) March 26, 2025 22:11
@SydneyhSmith SydneyhSmith self-requested a review March 26, 2025 23:03
@andyleejordan andyleejordan merged commit f172092 into main Mar 26, 2025
@andyleejordan andyleejordan deleted the homebrew branch March 26, 2025 23:04
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

Morty Proxy This is a proxified and sanitized view of the page, visit original site.