[Fix] add missing `local` (handle nonexisting /sbin/init a bit more cleanly)

lsfxz 2021-11-17 16:59:53 +01:00 committed by Jordan Harband
parent d004c6b064
commit fb4538b360
No known key found for this signature in database
GPG Key ID: 9F6A681E35EF8B56
1 changed files with 1 additions and 0 deletions

1
nvm.sh
View File

@ -1871,6 +1871,7 @@ nvm_get_arch() {
esac esac
# If running a 64bit ARM kernel but a 32bit ARM userland, change ARCH to 32bit ARM (armv7l) # 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 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 if [ "$(uname)" = "Linux" ] && [ "${NVM_ARCH}" = arm64 ] && [ "$(od -An -t x1 -j 4 -N 1 "${L#*-> }")" = ' 01' ]; then
NVM_ARCH=armv7l NVM_ARCH=armv7l