forked from blek/bshchk
1
0
Fork 0
bshchk/rdc.sh

26 lines
618 B
Bash
Raw Permalink Normal View History

2024-06-07 14:25:57 +02:00
# bshchk (https://git.blek.codes/blek/bshchk)
2024-06-02 11:32:17 +02:00
{{.DepsVar}}=({{.Deps}})
non_ok=()
for d in ${{.DepsVar}}
do
if ! command -v $d > /dev/null 2>&1; then
non_ok+=$d
fi
done
if (( ${#non_ok[@]} != 0 )); then
>&2 echo "RDC Failed!"
>&2 echo " This program requires these commands:"
>&2 echo " > ${{.DepsVar}}"
>&2 echo " --- "
>&2 echo " From which, these are missing:"
>&2 echo " > $non_ok"
>&2 echo "Make sure that those are installed and are present in \$PATH."
2024-06-22 13:21:53 +02:00
exit 1
2024-06-02 11:32:17 +02:00
fi
unset non_ok{{if .UnsetDeps}}
2024-09-07 09:06:28 +02:00
unset {{.DepsVar}}{{end}}
# Dependencies are OK at this point