Extract from require_tool an helper function to search for the tool, and
return the found path (instead of ignoring it).
---
dib/utils.ml | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/dib/utils.ml b/dib/utils.ml
index da5e738..967754d 100644
--- a/dib/utils.ml
+++ b/dib/utils.ml
@@ -90,11 +90,14 @@ let digit_prefix_compare a b =
let do_mkdir dir =
mkdir_p dir 0o755
-let require_tool tool =
- try ignore (which tool)
+let get_required_tool tool =
+ try which tool
with Executable_not_found tool ->
error (f_"%s needed but not found") tool
+let require_tool tool =
+ ignore (get_required_tool tool)
+
let do_cp src destdir =
let cmd = [ "cp"; "-t"; destdir; "-a"; src ] in
if run_command cmd <> 0 then exit 1
--
2.9.3