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"
|
||||
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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue