Skip to content

Commit

Permalink
Update maven-check-versions.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasleplus committed Apr 18, 2024
1 parent cdba4a8 commit 882a56a
Showing 1 changed file with 22 additions and 22 deletions.
44 changes: 22 additions & 22 deletions maven-check-versions/maven-check-versions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,37 +5,37 @@ IFS=$'\n\t'
shopt -s lastpipe

if [ -f mvnw ]; then
cmd='./mvnw'
if [ -n "${MAVEN_CONFIG+x}" ]; then
# resolve conflict with mvnw
unset MAVEN_CONFIG
fi
cmd='./mvnw'
if [ -n "${MAVEN_CONFIG+x}" ]; then
# resolve conflict with mvnw
unset MAVEN_CONFIG
fi
else
cmd='mvn'
cmd='mvn'
fi

if [ -z "${MAVEN_CLI_OPTS+x}" ]; then
opts=()
opts=()
else
IFS=' ' read -r -a opts <<< "${MAVEN_CLI_OPTS}"
IFS=' ' read -r -a opts <<<"${MAVEN_CLI_OPTS}"
fi

rc=0

"${cmd}" "${opts[@]}" \
versions:display-dependency-updates \
versions:display-plugin-updates \
versions:display-property-updates \
| while read -r l; do
\echo "${l}"
if [[ "${l}" == *"[ERROR]"*
|| "${l}" == *"has a newer version:"*
|| "${l}" == *"have newer versions:"*
|| "${l}" == *"update is available:"*
|| "${l}" == *"updates are available:"*
|| "${l}" == *"BUILD FAILURE"* ]]; then
rc=$((rc+1))
fi
done
versions:display-dependency-updates \
versions:display-plugin-updates \
versions:display-property-updates |
while read -r l; do
\echo "${l}"
if [[ "${l}" == *"[ERROR]"* ||
"${l}" == *"has a newer version:"* ||
"${l}" == *"have newer versions:"* ||
"${l}" == *"update is available:"* ||
"${l}" == *"updates are available:"* ||
"${l}" == *"BUILD FAILURE"* ]]; then
rc=$((rc + 1))
fi
done

exit ${rc}

0 comments on commit 882a56a

Please sign in to comment.