Improve detection and display of gzipped changelog

This commit is contained in:
Michael Boelen 2016-07-24 17:54:59 +02:00
parent 773c410a02
commit 6d6cd79a82
1 changed files with 10 additions and 6 deletions

View File

@ -123,15 +123,19 @@ if [ $# -gt 0 ]; then
CHANGELOG=""
if [ -z "${SEARCH_VERSION}" ]; then SEARCH_VERSION="${PROGRAM_VERSION}"; fi
STARTED=0
for FILE in ${CHANGELOG_PATHS}; do
if [ -f ${FILE}/CHANGELOG.md ]; then CHANGELOG="${FILE}/CHANGELOG.md"; fi
# We might come accross a gzipped changelog
if [ -f ${FILE}/changelog.gz ]; then
for FILEPATH in ${CHANGELOG_PATHS}; do
if [ -f ${FILEPATH}/CHANGELOG.md ]; then
CHANGELOG="${FILEPATH}/CHANGELOG.md"
# Check also for gzipped changelog
elif [ -f ${FILEPATH}/changelog.gz ]; then
ZCAT=$(which zcat 2> /dev/null)
if [ ! -z "${HAS_ZCAT}" ]; then
if [ ! -z "${ZCAT}" ]; then
CreateTempFile
CHANGELOG="${TEMP_FILE}"
${ZCAT} ${FILE}/changelog.gz > ${CHANGELOG}
LogText "Result: found gzipped changelog in ${FILEPATH}"
LogText "Action: Creating temporary file to store text"
${ZCAT} ${FILEPATH}/changelog.gz > ${CHANGELOG}
else
DisplayError "Could not find zcat utility to use on gzipped changelog"
fi
fi