Skip to content

Commit 140dcd0

Browse files
committed
Fixed intel mac avrsize.sh
1 parent 9437c63 commit 140dcd0

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

HeliosEmbedded/avrsize.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,13 @@ if [ "$OS" == "Windows_NT" ]; then
77
elif [ "$(uname -s)" == "Linux" ]; then
88
AVR_SIZE="${HOME}/atmel_setup/avr8-gnu-toolchain-linux_x86_64/bin/avr-size"
99
else
10-
AVR_SIZE="/opt/homebrew/bin/avr-size"
10+
# Auto-detect Homebrew installation path for macOS (Apple Silicon vs Intel Mac)
11+
if [ -d "/opt/homebrew" ]; then
12+
HOMEBREW_PREFIX="/opt/homebrew"
13+
else
14+
HOMEBREW_PREFIX="/usr/local"
15+
fi
16+
AVR_SIZE="${HOMEBREW_PREFIX}/bin/avr-size"
1117
fi
1218

1319
if [ ! -x "$AVR_SIZE" ]; then

0 commit comments

Comments
 (0)