|
@@ -1,3 +1,22 @@
|
|
|
|
+#!/bin/bash
|
|
|
|
+ESSENTIAL_GENERIC=(
|
|
|
|
+ cat
|
|
|
|
+ echo
|
|
|
|
+ ls
|
|
|
|
+ sort
|
|
|
|
+)
|
|
|
|
+ESSENTIAL_SYSTEM_SPECIFIC=(
|
|
|
|
+ awk
|
|
|
|
+ find
|
|
|
|
+ head
|
|
|
|
+ tail
|
|
|
|
+ xargs
|
|
|
|
+)
|
|
|
|
+NONESSENTIAL=(
|
|
|
|
+ # TODO: add built-in minimal replacement for fzf
|
|
|
|
+ fzf
|
|
|
|
+)
|
|
|
|
+
|
|
get_subprog () {
|
|
get_subprog () {
|
|
# NOTE: for progams that wrap calls to others
|
|
# NOTE: for progams that wrap calls to others
|
|
# such as sudo, and time, the actual
|
|
# such as sudo, and time, the actual
|
|
@@ -10,3 +29,17 @@ get_subprog () {
|
|
echo "$2" # naive - what if sudo is invoked with options?
|
|
echo "$2" # naive - what if sudo is invoked with options?
|
|
fi
|
|
fi
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+check_deps () {
|
|
|
|
+ for dep in "${ESSENTIAL_GENERIC[@]}" "${ESSENTIAL_SYSTEM_SPECIFIC[@]}"
|
|
|
|
+ do
|
|
|
|
+ which "$dep" || {
|
|
|
|
+ echo "essential dependencies missing: $dep" >&3
|
|
|
|
+ exit 1
|
|
|
|
+ }
|
|
|
|
+ done
|
|
|
|
+ for dep in "${NONESSENTIAL[@]}"
|
|
|
|
+ do
|
|
|
|
+ which "$dep" || echo "non-essential dependencies missing: $dep" >&2
|
|
|
|
+ done
|
|
|
|
+}
|