Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement debug logging mode #133

Merged
merged 2 commits into from
Oct 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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