Skip to content

Commit

Permalink
Implement debug logging mode (#133)
Browse files Browse the repository at this point in the history
* Implement debug mode

* Linting
  • Loading branch information
thomasleplus authored Oct 28, 2024
1 parent 2b015cf commit 72998a1
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions maven-check-versions/maven-check-versions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,34 @@ IFS=$'\n\t'

shopt -s lastpipe

# debug mode is off by default
if [ -z "${DEBUG+x}" ]; then
DEBUG=false
fi

# Honoring GitHub runner debug mode
if [ "${ACTIONS_RUNNER_DEBUG}" = true ]; then
DEBUG=true
fi

if [ "${DEBUG}" = true ]; then
set -o xtrace
\echo "DEBUG: current working directory = $(pwd)"
\echo 'DEBUG:'
# shellcheck disable=SC2012
\ls -hal | \sed -e 's/^/DEBUG: /'
\echo 'DEBUG:'
fi

if [ -f mvnw ]; then
\echo 'DEBUG: using existing maven wrapper'
cmd='./mvnw'
if [ -n "${MAVEN_CONFIG+x}" ]; then
# resolve conflict with mvnw
unset MAVEN_CONFIG
fi
else
\echo 'DEBUG: using docker-provided maven command'
cmd='mvn'
fi

Expand Down

0 comments on commit 72998a1

Please sign in to comment.