Skip to content

Commit 34813b6

Browse files
committed
feat(sam): check for sam cli in /opt/homebrew/
Problem: On macos ARM (M1) systems, homebrew installs to `/opt/homebrew` instead of `/usr/local`. But `UnixSamCliLocator` doesn't check this, so 1. it searches $PATH (slow) 2. won't find `sam` if `/opt/homebrew` is not in $PATH for some reason Solution: Add `/opt/homebrew` to `UnixSamCliLocator`.
1 parent 9b88c69 commit 34813b6

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/shared/sam/cli/samCliLocator.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ class WindowsSamCliLocator extends BaseSamCliLocator {
177177

178178
class UnixSamCliLocator extends BaseSamCliLocator {
179179
private static readonly locationPaths: string[] = [
180+
'/opt/homebrew/bin/sam',
180181
'/usr/local/bin',
181182
'/usr/bin',
182183
// WEIRD BUT TRUE: brew installs to /home/linuxbrew/.linuxbrew if

0 commit comments

Comments
 (0)