aboutsummaryrefslogtreecommitdiff
path: root/lib/dependencies.sh
diff options
context:
space:
mode:
Diffstat (limited to 'lib/dependencies.sh')
-rw-r--r--lib/dependencies.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/dependencies.sh b/lib/dependencies.sh
new file mode 100644
index 0000000..bb86be3
--- /dev/null
+++ b/lib/dependencies.sh
@@ -0,0 +1,12 @@
+#!/usr/bin/env sh
+
+ensure_command_exists() {
+ _cmd=$1
+ _ret=0
+ if [ -z "${_cmd}" ]; then
+ _execution_error error=missing_argument function=ensure_command_exists argument=cmd
+ fi
+ if ! which "$1" > /dev/null 2>&1; then
+ _execution_error error=missing_dependency dependency="${_cmd}"
+ fi
+}