aboutsummaryrefslogtreecommitdiff
path: root/.github/scripts
diff options
context:
space:
mode:
authorbombcar <github@bombcar.com>2022-02-16 00:14:39 -0600
committerGitHub <noreply@github.com>2022-02-16 07:14:39 +0100
commit9e3ad3d03eb4b854353549316f9a5b438e95a6da (patch)
treec136556b97ad9d1a9123434b3ef75aa125d21514 /.github/scripts
parent34f8d8f3fb3e9154452d3c6ae95b2f46757dc195 (diff)
downloadGT5-Unofficial-9e3ad3d03eb4b854353549316f9a5b438e95a6da.tar.gz
GT5-Unofficial-9e3ad3d03eb4b854353549316f9a5b438e95a6da.tar.bz2
GT5-Unofficial-9e3ad3d03eb4b854353549316f9a5b438e95a6da.zip
fix runserver (#18)
* fix runserver * needs decop
Diffstat (limited to '.github/scripts')
-rwxr-xr-x.github/scripts/test_no_error_reports (renamed from .github/scripts/test-no-error-reports.sh)22
1 files changed, 14 insertions, 8 deletions
diff --git a/.github/scripts/test-no-error-reports.sh b/.github/scripts/test_no_error_reports
index cfce0261a5..1fcc7396c6 100755
--- a/.github/scripts/test-no-error-reports.sh
+++ b/.github/scripts/test_no_error_reports
@@ -1,14 +1,19 @@
#!/usr/bin/env bash
-RUNDIR="run"
-CRASH="crash-reports"
-SERVERLOG="server.log"
+# bashsupport disable=BP5006 # Global environment variables
+RUNDIR="run" \
+ CRASH="crash-reports" \
+ SERVERLOG="server.log"
# enable nullglob to get 0 results when no match rather than the pattern
shopt -s nullglob
-# store matches in array (don't forget to double-quote variables expansion
-crash_reports=( "$RUNDIR/$CRASH/crash"*.txt )
+
+# store matches in array
+crash_reports=("$RUNDIR/$CRASH/crash"*.txt)
+
+# if array not empty there are crash_reports
if [ "${#crash_reports[@]}" -gt 0 ]; then
+ # get the latest crash_report from array
latest_crash_report="${crash_reports[-1]}"
{
printf 'Latest crash report detected %s:\n' "${latest_crash_report##*/}"
@@ -19,13 +24,14 @@ fi
if grep --quiet --fixed-strings 'Fatal errors were detected' "$SERVERLOG"; then
{
- printf 'Fatal errors detected:'
+ printf 'Fatal errors detected:\n'
cat server.log
} >&2
exit 1
fi
-if grep --quiet --fixed-strings 'The state engine was in incorrect state ERRORED and forced into state SERVER_STOPPED' "$SERVERLOG"; then
+if grep --quiet --fixed-strings 'The state engine was in incorrect state ERRORED and forced into state SERVER_STOPPED' \
+ "$SERVERLOG"; then
{
printf 'Server force stopped:'
cat server.log
@@ -33,7 +39,7 @@ if grep --quiet --fixed-strings 'The state engine was in incorrect state ERRORED
exit 1
fi
-if ! grep --quiet -Po '.+Done \(.+\)\! For help, type "help" or "\?"' "$SERVERLOG"; then
+if ! grep --quiet --perl-regexp --only-matching '.+Done \(.+\)\! For help, type "help" or "\?"' "$SERVERLOG"; then
{
printf 'Server did not finish startup:'
cat server.log