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:
parent
9e47ae54e7
commit
a2491aa355
1 changed files with 21 additions and 3 deletions
24
install.sh
24
install.sh
|
|
@ -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"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue