Skip to content

Commit 3cf4b4b

Browse files
committed
fix(rustup-init/sh): avoid hw.optional.*: 1 stdout in macOS arch check
1 parent 8647906 commit 3cf4b4b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

rustup-init.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ get_architecture() {
348348
# See: <https://support.apple.com/en-us/HT208436>
349349

350350
# Avoid `sysctl: unknown oid` stderr output and/or non-zero exit code.
351-
if sysctl hw.optional.x86_64 2> /dev/null || true | grep -q ': 1'; then
351+
if (sysctl hw.optional.x86_64 2> /dev/null || true) | grep -q ': 1'; then
352352
_cputype=x86_64
353353
fi
354354
elif [ "$_cputype" = x86_64 ]; then
@@ -357,7 +357,7 @@ get_architecture() {
357357
# Rosetta 2 is built exclusively for x86-64 and cannot run i386 binaries.
358358

359359
# Avoid `sysctl: unknown oid` stderr output and/or non-zero exit code.
360-
if sysctl hw.optional.arm64 2> /dev/null || true | grep -q ': 1'; then
360+
if (sysctl hw.optional.arm64 2> /dev/null || true) | grep -q ': 1'; then
361361
_cputype=arm64
362362
fi
363363
fi

0 commit comments

Comments
 (0)