mirror of
https://github.com/nvm-sh/nvm.git
synced 2025-05-10 14:21:50 +00:00
Remove useless -q option in ls
command
This commit adds support to minimal distros or unsupported distros such as Alpine Linux (uses busybox) by preventing the error which says '-q' option isn't supported. Also, '-q' option in ls command isn't actually required because what '-q' option does is just prints '?' character instead of nongraphic characters. (Prevent error being shown) ## References - https://linuxcommand.org/lc3_man_pages/ls1.html -q, --hide-control-chars print ? instead of nongraphic characters
This commit is contained in:
parent
11a9d22607
commit
83d7db0851
6
nvm.sh
6
nvm.sh
@ -1121,13 +1121,13 @@ nvm_ls() {
|
||||
fi
|
||||
fi
|
||||
|
||||
if ! [ -d "${NVM_DIRS_TO_SEARCH1}" ] || ! (command ls -1qA "${NVM_DIRS_TO_SEARCH1}" | nvm_grep -q .); then
|
||||
if ! [ -d "${NVM_DIRS_TO_SEARCH1}" ] || ! (command ls -1A "${NVM_DIRS_TO_SEARCH1}" | nvm_grep -q .); then
|
||||
NVM_DIRS_TO_SEARCH1=''
|
||||
fi
|
||||
if ! [ -d "${NVM_DIRS_TO_SEARCH2}" ] || ! (command ls -1qA "${NVM_DIRS_TO_SEARCH2}" | nvm_grep -q .); then
|
||||
if ! [ -d "${NVM_DIRS_TO_SEARCH2}" ] || ! (command ls -1A "${NVM_DIRS_TO_SEARCH2}" | nvm_grep -q .); then
|
||||
NVM_DIRS_TO_SEARCH2="${NVM_DIRS_TO_SEARCH1}"
|
||||
fi
|
||||
if ! [ -d "${NVM_DIRS_TO_SEARCH3}" ] || ! (command ls -1qA "${NVM_DIRS_TO_SEARCH3}" | nvm_grep -q .); then
|
||||
if ! [ -d "${NVM_DIRS_TO_SEARCH3}" ] || ! (command ls -1A "${NVM_DIRS_TO_SEARCH3}" | nvm_grep -q .); then
|
||||
NVM_DIRS_TO_SEARCH3="${NVM_DIRS_TO_SEARCH2}"
|
||||
fi
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user