feat: Check dependencies
This commit is contained in:
parent
84c60bf198
commit
a5b474b1bf
24
warp4j
24
warp4j
@ -62,6 +62,30 @@ function get_this_platform() {
|
||||
|
||||
THIS_PLATFORM=$(get_this_platform)
|
||||
|
||||
# check if all dependencies available
|
||||
function check_deps() {
|
||||
local deps=("warp-packer" \
|
||||
"curl" \
|
||||
"awk" \
|
||||
"sed")
|
||||
local missing=()
|
||||
for d in ${deps[@]}; do
|
||||
if ! command -v $d &> /dev/null ; then
|
||||
missing+=($d)
|
||||
fi
|
||||
done
|
||||
if [[ $missing ]]; then
|
||||
echo -n "Error: Missing dependencies: " >&2
|
||||
for d in ${missing[@]}; do
|
||||
echo -n "$d " >&2
|
||||
done
|
||||
echo >&2
|
||||
fail
|
||||
fi
|
||||
}
|
||||
|
||||
check_deps
|
||||
|
||||
if [[ $# -eq 0 ]]; then
|
||||
print_help
|
||||
exit
|
||||
|
Loading…
Reference in New Issue
Block a user