added no color option to run script

This commit is contained in:
Ziver Koc 2023-05-16 01:43:16 +02:00
parent 070aeb35d7
commit 6acf0ad031

12
run.sh Executable file → Normal file
View file

@ -19,6 +19,7 @@ Where:
}
MODE="FOREGROUND"
GRADLE_COLOR="--console=rich"
until [[ $# -eq 0 ]]; do
case "$1" in
@ -32,6 +33,11 @@ until [[ $# -eq 0 ]]; do
shift
;;
--no-color)
GRADLE_COLOR="--no-color"
shift
;;
-h|--help)
printHelp
exit 0
@ -88,7 +94,7 @@ if [[ -d "./hal-core/src" ]]; then
echo "INFO: Operating in source directory, will build Hal."
INSTALL_DIR="./build/install/Hal"
./gradlew --console=rich installDist
./gradlew ${GRADLE_COLOR} installDist
EXIT_CODE=$?
if [[ ${EXIT_CODE} -ne 0 ]]; then
@ -111,14 +117,14 @@ if [[ ${MODE} == "FOREGROUND" ]]; then
while [[ ${EXIT_CODE} -eq 200 ]]; do
# Restart as long as we have a exit code of 200, this allows the application to restart itself
#startHal
./gradlew run
./gradlew ${GRADLE_COLOR} run
EXIT_CODE=$?
done
elif [[ ${MODE} == "BACKGROUND" ]]; then
# Kill current session
screen -S hal -X kill
# Start new session
screen -S hal -L -d -m $(dirname "$0")/run.sh --foreground
screen -S hal -L -d -m $(dirname "$0")/run.sh --foreground --no-color
echo "-------------------------"
screen -list