chore: Show missing dependencies after install

This commit is contained in:
Serge Guzik 2019-02-15 11:31:04 +02:00
parent 7670f5d03a
commit 19ebc90cc5

34
install
View File

@ -70,11 +70,43 @@ function install() {
fi fi
} }
# returns missing dependencies
function get_missing_deps() {
local deps=(
"awk" \
"curl" \
"grep" \
"sed" \
"sort" \
"tar" \
"unzip" \
"zip" \
)
for d in ${deps[@]}; do
if ! command -v $d &> /dev/null ; then
echo -n "$d "
fi
done
}
WARP4J_LINK="https://raw.githubusercontent.com/guziks/warp4j/master/warp4j" WARP4J_LINK="https://raw.githubusercontent.com/guziks/warp4j/master/warp4j"
echo "Getting information about warp-packer releases..." echo "Getting information about warp-packer releases..."
WARP_LINK=$(get_latest_warp_link $THIS_PLATFORM) WARP_LINK=$(get_latest_warp_link $THIS_PLATFORM)
MISSING_DEPS=$(get_missing_deps)
install "warp-packer" "$WARP_LINK" && \ install "warp-packer" "$WARP_LINK" && \
install "warp4j" "$WARP4J_LINK" && \ install "warp4j" "$WARP4J_LINK"
if [[ -z $MISSING_DEPS ]]; then
echo "Successfully installed" echo "Successfully installed"
else
echo "Main tools successfully installed"
echo "Please install following with your package manager:"
for d in ${MISSING_DEPS[@]}; do
echo -n "$d "
done
echo
exit 1
fi