Skip to content

Commit f3c4fa2

Browse files
committed
updates to platform_arch checks
notably use arm64 even if bash is running under rosetta
1 parent 92aea67 commit f3c4fa2

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

restore.sh

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -349,12 +349,11 @@ set_tool_paths() {
349349
dir="../bin/linux/"
350350

351351
# architecture check
352-
if [[ $(uname -m) == "a"* && $(getconf LONG_BIT) == 64 ]]; then
352+
platform_arch="$(uname -m)"
353+
if [[ $platform_arch == "aarch64" ]]; then
353354
platform_arch="arm64"
354-
elif [[ $(uname -m) == "x86_64" ]]; then
355-
platform_arch="x86_64"
356355
else
357-
error "Your architecture ($(uname -m)) is not supported."
356+
error "Your architecture ($platform_arch) is not supported."
358357
fi
359358
dir+="$platform_arch"
360359

@@ -528,9 +527,8 @@ set_tool_paths() {
528527
dir="../bin/macos"
529528

530529
platform_arch="$(uname -m)"
531-
if [[ $platform_arch == "arm64" ]]; then
532-
dir+="/arm64"
533-
fi
530+
[[ $(sysctl -in hw.optional.arm64) == 1 ]] && platform_arch="arm64"
531+
[[ $platform_arch == "arm64" ]] && dir+="/arm64"
534532

535533
# macos checks
536534
if [[ $mac_majver == 10 ]]; then

0 commit comments

Comments
 (0)