From d75cfc6c9f91befc6b4cf48a91254f26a366ddd8 Mon Sep 17 00:00:00 2001 From: John Gee Date: Fri, 16 Aug 2024 16:17:59 +1200 Subject: [PATCH] Remove redundant checks for commands --- bin/n | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/bin/n b/bin/n index 94de453..5466101 100755 --- a/bin/n +++ b/bin/n @@ -1456,7 +1456,7 @@ function show_diagnostics() { printf "\nnode\n" if command -v node &> /dev/null; then - command -v node && node --version + node --version node -e 'if (process.versions.v8) console.log("JavaScript engine: v8");' printf "\nnpm\n" @@ -1465,23 +1465,23 @@ function show_diagnostics() { printf "\ntar\n" if command -v tar &> /dev/null; then - command -v tar && tar --version + tar --version else echo_red "tar not found. Needed for extracting downloads." fi printf "\ncurl or wget\n" if command -v curl &> /dev/null; then - command -v curl && curl --version + curl --version elif command -v wget &> /dev/null; then - command -v wget && wget --version + wget --version else echo_red "Neither curl nor wget found. Need one of them for downloads." fi printf "\njq\n" if command -v jq &> /dev/null; then - command -v jq && jq --version + jq --version else echo "jq not found, can be used to get package.json values faster than node" fi