Skip to content

Commit 258b8f5

Browse files
committed
detect architecture with sysctl rather than uname. See #2420.
1 parent b6b8b37 commit 258b8f5

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

package/scripts/common/quarto

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,13 +121,16 @@ else
121121
export DENO_DOM_PLUGIN=$QUARTO_BIN_PATH/tools/deno_dom/libplugin.so
122122
fi
123123

124+
124125
if [ "$QUARTO_DENO" == "" ]; then
125126
if [[ $OSTYPE == 'darwin'* ]]; then
126-
FULLARCH=$(uname -sm)
127+
# We cannot use uname to determine the _machine_ architecture:
128+
# https://github.com/quarto-dev/quarto-cli/issues/2420#issuecomment-1245768732
129+
FULLARCH="$(sysctl machdep.cpu.brand_string)"
127130

128-
if [[ $FULLARCH == "Darwin x86_64" ]]; then
131+
if [[ $FULLARCH == *"Intel"* ]]; then
129132
DENO_DIR=deno-x86_64-apple-darwin
130-
elif [[ $FULLARCH == "Darwin arm64" ]]; then
133+
elif [[ $FULLARCH == *"Apple"* ]]; then
131134
DENO_DIR=deno-aarch64-apple-darwin
132135
else
133136
echo "quarto script failed: unrecognized architecture " ${FULLARCH}

0 commit comments

Comments
 (0)