1
0
Fork 0
mirror of https://github.com/eosswedenorg/thalos synced 2026-06-16 04:24:56 +02:00

install.sh: improve error checking.

This commit is contained in:
Henrik Hautakoski 2024-01-22 14:39:14 +01:00
parent 9e47ae54e7
commit a2491aa355

View file

@ -7,10 +7,28 @@ fi
INSTALL_DIR=$1
echo "Installing application in: $INSTALL_DIR"
echo -e "\033[34m-\033[0m Installing application in: $INSTALL_DIR"
PROGRAMS=(make go)
missing_prog=0
for prog in ${PROGRAMS[@]}; do
CMD=$(which $prog)
if [ -z "$CMD" ]; then
echo -e "\033[31m!!\033[0m Failed to locate $prog, please install this program"
missing_prog=1
fi
done
if [ $missing_prog -ne 0 ]; then
exit 1
fi
mkdir -p "$INSTALL_DIR"/{bin,logs}
make -e DESTDIR=$INSTALL_DIR PREFIX= CFGDIR= install install-scripts
if [ $? -ne 0 ]; then
echo -e "\033[31m!!\033[0m Installation failed"
exit 1
fi
echo "Done"
echo -e "\033[32m*\033[0m Done"