From 83d7db0851d3756159dd0533fcf2d4934cba733c Mon Sep 17 00:00:00 2001 From: Seia-Soto <30369714+Seia-Soto@users.noreply.github.com> Date: Tue, 10 Nov 2020 05:45:22 +0900 Subject: [PATCH] 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 --- nvm.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nvm.sh b/nvm.sh index 13dcb01..b71a71d 100644 --- a/nvm.sh +++ b/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