Skip to content

Commit

Permalink
handle nonexisting /sbin/init a bit more cleanly
Browse files Browse the repository at this point in the history
move additional check into subshell

local
  • Loading branch information
lsfxz committed Dec 14, 2021
1 parent 6cc90a4 commit 4a8d10a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions nvm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1851,6 +1851,7 @@ nvm_get_arch() {
esac

# If running a 64bit ARM kernel but a 32bit ARM userland, change ARCH to 32bit ARM (armv7l)
local L
L=$(ls -dl /sbin/init 2>/dev/null) # if /sbin/init is 32bit executable
if [ "$(uname)" = "Linux" ] && [ "${NVM_ARCH}" = arm64 ] && [ "$(od -An -t x1 -j 4 -N 1 "${L#*-> }")" = ' 01' ]; then
NVM_ARCH=armv7l
Expand Down

0 comments on commit 4a8d10a

Please sign in to comment.