[Fix] `nvm_get_arch`: suppress error output if `/sbin` does not exist

Introduced by #2469
Jordan Harband 2021-08-05 08:05:54 -07:00
parent 7ba49f8f71
commit 7f2ccd51d4
No known key found for this signature in database
GPG Key ID: 9F6A681E35EF8B56
1 changed files with 1 additions and 1 deletions

2
nvm.sh
View File

@ -1818,7 +1818,7 @@ nvm_get_arch() {
esac
# If running a 64bit ARM kernel but a 32bit ARM userland, change ARCH to 32bit ARM (armv7l)
L=$(ls -dl /sbin/init) # 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
NVM_ARCH=armv7l
HOST_ARCH=armv7l