Skip to content

Commit

Permalink
Release v1.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
navrocky committed Feb 11, 2025
1 parent 8d8be95 commit 93a3853
Show file tree
Hide file tree
Showing 4 changed files with 85 additions and 7 deletions.
20 changes: 15 additions & 5 deletions CHANGELOG.md
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Download and copy binary to any destination specified in `PATH` (~/bin, /usr/loc
Do not forget to set execution flag on binary with `chmod`.

```sh
sudo curl https://github.com/navrocky/muenvsubst/releases/download/1.3.0/muenvsubst -Lo /usr/local/bin/muenvsubst
sudo curl https://github.com/navrocky/muenvsubst/releases/download/1.4.0/muenvsubst -Lo /usr/local/bin/muenvsubst
sudo chmod +x /usr/local/bin/muenvsubst
```

Expand Down
2 changes: 1 addition & 1 deletion cli/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ using namespace std;
using namespace std::placeholders;
using namespace Args;

const char* APP_VERSION = "1.3.0";
const char* APP_VERSION = "1.4.0";

int main(int argc, char** argv, char** envp)
{
Expand Down
68 changes: 68 additions & 0 deletions update_changelog_from_git.sh
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

0 comments on commit 93a3853

Please sign in to comment.