From ca9cc5792d1eda09ce4961407c4ceeadc7fe9b12 Mon Sep 17 00:00:00 2001
From: "Hahn Axel (hahn)" <axel.hahn@unibe.ch>
Date: Tue, 5 Sep 2023 16:33:38 +0200
Subject: [PATCH] update ph.require

---
 inc_pluginfunctions | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/inc_pluginfunctions b/inc_pluginfunctions
index aabe5d8..3740c11 100644
--- a/inc_pluginfunctions
+++ b/inc_pluginfunctions
@@ -39,6 +39,7 @@
 # 2023-06-22  v1.11 <axel.hahn@unibe.ch>      fix ph.toUnit with float values; shell fixes
 # 2023-08-24  v1.12 <axel.hahn@unibe.ch>      toUnit got 3rd param for count of digits after "."
 # 2023-08-30  v1.13 <axel.hahn@unibe.ch>      reverse return code in ph.hasParamoption to unix like return codes: 0=true; <>0 = false
+# 2023-09-05  v1.14 <axel.hahn@unibe.ch>      ph.require - show error below status line
 # ======================================================================
 
 
@@ -62,10 +63,11 @@ function ph.abort(){
 # check required binaries in the path
 # param(s)  string  name of binary to check with "which" command
 function ph.require(){
-  which $* >/dev/null 
-  if [ $? -ne 0 ]; then
+  local _out;
+  if ! _out=$( which $* 2>&1 ); then
       ph.setStatus "unknown"
       ph.status "$0 requires the following tools to run: $*"
+      echo "$_out"
       ph.exit
   fi
 }
-- 
GitLab