From 774fc26eeb01345c11bd8c97e2c4f328d419d9b5 Mon Sep 17 00:00:00 2001 From: Alexander Gudulin Date: Mon, 18 Feb 2019 23:25:10 +0100 Subject: [PATCH] install.sh: print out tar version when the flag is supported (#154) not all the tar implementations support --version flag e.g. the one used in openbsd doesn't, so the installation process fails PR-URL: https://github.com/npm/cli/pull/154 Credit: @agudulin Reviewed-By: @zkat --- scripts/install.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/install.sh b/scripts/install.sh index e352e55caf042..4ed1062aa1308 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -98,8 +98,10 @@ fi if [ $ret -eq 0 ] && [ -x "$tar" ]; then echo "tar=$tar" - echo "version:" - $tar --version + if [ $tar --version > /dev/null 2>&1 ]; then + echo "version:" + $tar --version + fi ret=$? fi