Przeglądaj źródła

Fix `show-version` error on multiline version text

For some reason, `vim --version | head -n 1` generates a failure in
CentOS 5. Works without `-n 1`. I also cannot catch any return errors
with `$?` to find out more. Either way, that line should always be
considered a pass, so we add the standard bash-strict-mode `|| true` to
ignore the error.
Weiyi Lou 9 lat temu
rodzic
commit
a31028e912
1 zmienionych plików z 1 dodań i 1 usunięć
  1. 1 1
      bin/show-versions

+ 1 - 1
bin/show-versions

@@ -22,7 +22,7 @@ version_commands=( \
 for ver_com in ${version_commands[@]}; do
   com=${ver_com%% *}
   if [[ -n $(command -v $com) ]]; then
-    eval "$ver_com" | head -n 1
+    eval "$ver_com" | head -n 1 || true
   else
     echo "$com - none"
   fi