[Fix] add missing `local` (handle nonexisting /sbin/init a bit more cleanly)
parent
d004c6b064
commit
fb4538b360
1
nvm.sh
1
nvm.sh
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue