From 7cf539708fcf5ab571de8f7b74e809c41d973bb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ale=C5=A1=20Fabi=C3=A1nek?= Date: Sun, 21 Jan 2024 10:38:41 +0100 Subject: [PATCH] Pass output to both file and console --- .github/scripts/run-client.sh | 2 +- .github/scripts/run-server.sh | 4 +++- Makefile | 25 +++++++++++++++++++++++-- 3 files changed, 27 insertions(+), 4 deletions(-) diff --git a/.github/scripts/run-client.sh b/.github/scripts/run-client.sh index 518de54..a4fd778 100755 --- a/.github/scripts/run-client.sh +++ b/.github/scripts/run-client.sh @@ -1,6 +1,6 @@ #!/bin/bash -./gradlew $1:runClient > gradle_client_output.txt 2>&1 & +./gradlew $1:runClient --no-daemon 2>&1 | tee gradle_client_output.txt & SUCCESS_PATTERN='minecraft:textures/atlas/mob_effects\.png-atlas' ERROR_PATTERNS=( diff --git a/.github/scripts/run-server.sh b/.github/scripts/run-server.sh index ae7b8a4..a8dfe97 100755 --- a/.github/scripts/run-server.sh +++ b/.github/scripts/run-server.sh @@ -1,6 +1,8 @@ #!/bin/bash -./gradlew $1:runServer --args="nogui" > gradle_server_output.txt 2>&1 & +mkdir -p $1/run && echo "eula=true" > $1/run/eula.txt + +./gradlew $1:runServer --no-daemon --args="nogui" 2>&1 | tee gradle_server_output.txt & SUCCESS_PATTERN='For help, type "help"' ERROR_PATTERNS=( diff --git a/Makefile b/Makefile index a1ce068..b8bbce4 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ help: ## Prints help for targets with comments @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' build-project: ## Builds project - ./gradlew build --stacktrace --info + ./gradlew build refresh: ## Refresh dependencies ./gradlew --refresh-dependencies @@ -13,5 +13,26 @@ clean-cache: ## Cleans cache rm -rf $GRADLE_HOME/caches/build-cache-* ./gradlew clean +stop: ## Stops all deamons + ./gradlew --stop + gen-sources: ## Generate sources - ./gradlew genSources \ No newline at end of file + ./gradlew genSources + +run-fabric-client: ## Runs fabric client + ./gradlew fabric:runClient + +run-forge-client: ## Runs forge client + ./gradlew forge:runClient + +run-neoforge-client: ## Runs neoforge client + ./gradlew neoforge:runClient + +run-fabric-server: ## Runs fabric server + ./gradlew fabric:runServer + +run-forge-server: ## Runs forge server + ./gradlew forge:runServer + +run-neoforge-server: ## Runs neoforge server + ./gradlew neoforge:runServer \ No newline at end of file