-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
85 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,18 @@ | ||
# 1.3.0 (2025.02.04) | ||
# 1.4.0 (2025-02-12) | ||
|
||
* Add function to convert bool string variable to bool (varToBool) | ||
* Remove Mstch engine | ||
- Add command line parameters to read and write file instead of stdin/stdout | ||
- Add pipe syntax for function calling | ||
- Add base64 encode and decode functions | ||
- Add toJson and fromJson functions | ||
- Add shell function | ||
- Add trim function | ||
- Add toBool function | ||
|
||
# 1.2.0 (2025.01.23) | ||
# 1.3.0 (2025-02-04) | ||
|
||
* Add Inja engine | ||
- Add function to convert bool string variable to bool (varToBool) | ||
- Remove Mstch engine | ||
|
||
# 1.2.0 (2025-01-23) | ||
|
||
- Add Inja engine |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
CHANGELOG="CHANGELOG.md" | ||
|
||
getLastTagFromChangeLog() { | ||
grep -oE "([0-9X]+\.){2}[0-9X]" <"$1" | head -n1 | ||
} | ||
|
||
printNewRelease() { | ||
LAST_VERSION="$1" | ||
|
||
echo "# X.X.X ($(date +%Y-%m-%d))" | ||
echo | ||
|
||
if [ -z "${LAST_VERSION}" ]; then | ||
COMMITS="HEAD" | ||
else | ||
COMMITS="${LAST_VERSION}..HEAD" | ||
fi | ||
GIT_LOG_COMMAND="git log --format=%s ${COMMITS}" | ||
$GIT_LOG_COMMAND | while IFS=$'\n' read -r LINE; do | ||
echo "- $LINE" | ||
done | ||
|
||
echo | ||
} | ||
|
||
generateChangeLog() { | ||
printNewRelease >>${CHANGELOG} | ||
|
||
echo "The initial ${CHANGELOG} generated" | ||
} | ||
|
||
updateChangeLog() { | ||
LAST_VERSION="$1" | ||
|
||
if [ "${LAST_VERSION}" == "X.X.X" ]; then | ||
echo "The ${CHANGELOG} already contains raw git log" | ||
exit 1 | ||
fi | ||
|
||
TMP_CHANGELOG="${CHANGELOG}.tmp" | ||
[ -f "${TMP_CHANGELOG}" ] && rm ${TMP_CHANGELOG} | ||
|
||
# copy original change log and insert new release | ||
cat ${CHANGELOG} | while IFS=$'\n' read -r LINE; do | ||
if [[ "${LINE}" == *"${LAST_VERSION}"* ]]; then | ||
printNewRelease "${LAST_VERSION}" >>${TMP_CHANGELOG} | ||
fi | ||
echo "${LINE}" >>${TMP_CHANGELOG} | ||
done | ||
|
||
mv ${TMP_CHANGELOG} ${CHANGELOG} | ||
|
||
echo "The ${CHANGELOG} updated with a recent commits after the tag ${LAST_VERSION}" | ||
} | ||
|
||
if [ -f "${CHANGELOG}" ]; then | ||
LAST_VERSION=$(getLastTagFromChangeLog ${CHANGELOG}) | ||
fi | ||
|
||
if [ -z "${LAST_VERSION}" ]; then | ||
generateChangeLog | ||
else | ||
updateChangeLog "${LAST_VERSION}" | ||
fi |