added no color option to run script
This commit is contained in:
parent
070aeb35d7
commit
6acf0ad031
1 changed files with 9 additions and 3 deletions
12
run.sh
Executable file → Normal file
12
run.sh
Executable file → Normal file
|
|
@ -19,6 +19,7 @@ Where:
|
||||||
}
|
}
|
||||||
|
|
||||||
MODE="FOREGROUND"
|
MODE="FOREGROUND"
|
||||||
|
GRADLE_COLOR="--console=rich"
|
||||||
|
|
||||||
until [[ $# -eq 0 ]]; do
|
until [[ $# -eq 0 ]]; do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
|
|
@ -32,6 +33,11 @@ until [[ $# -eq 0 ]]; do
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
--no-color)
|
||||||
|
GRADLE_COLOR="--no-color"
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
|
||||||
-h|--help)
|
-h|--help)
|
||||||
printHelp
|
printHelp
|
||||||
exit 0
|
exit 0
|
||||||
|
|
@ -88,7 +94,7 @@ if [[ -d "./hal-core/src" ]]; then
|
||||||
echo "INFO: Operating in source directory, will build Hal."
|
echo "INFO: Operating in source directory, will build Hal."
|
||||||
INSTALL_DIR="./build/install/Hal"
|
INSTALL_DIR="./build/install/Hal"
|
||||||
|
|
||||||
./gradlew --console=rich installDist
|
./gradlew ${GRADLE_COLOR} installDist
|
||||||
EXIT_CODE=$?
|
EXIT_CODE=$?
|
||||||
|
|
||||||
if [[ ${EXIT_CODE} -ne 0 ]]; then
|
if [[ ${EXIT_CODE} -ne 0 ]]; then
|
||||||
|
|
@ -111,14 +117,14 @@ if [[ ${MODE} == "FOREGROUND" ]]; then
|
||||||
while [[ ${EXIT_CODE} -eq 200 ]]; do
|
while [[ ${EXIT_CODE} -eq 200 ]]; do
|
||||||
# Restart as long as we have a exit code of 200, this allows the application to restart itself
|
# Restart as long as we have a exit code of 200, this allows the application to restart itself
|
||||||
#startHal
|
#startHal
|
||||||
./gradlew run
|
./gradlew ${GRADLE_COLOR} run
|
||||||
EXIT_CODE=$?
|
EXIT_CODE=$?
|
||||||
done
|
done
|
||||||
elif [[ ${MODE} == "BACKGROUND" ]]; then
|
elif [[ ${MODE} == "BACKGROUND" ]]; then
|
||||||
# Kill current session
|
# Kill current session
|
||||||
screen -S hal -X kill
|
screen -S hal -X kill
|
||||||
# Start new session
|
# 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 "-------------------------"
|
echo "-------------------------"
|
||||||
screen -list
|
screen -list
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue