FHEM-NTFY/scripts/generate_control.sh
Dominik Meyer 6e20d6675a
All checks were successful
continuous-integration/drone/push Build is passing
ADD: started ci/cd
2024-03-02 09:59:46 +01:00

31 lines
685 B
Bash
Executable File

#!/bin/bash
CONTROL_FILE="controls_byterazor-fhem-ntfy.txt"
if [ -e $CONTROL_FILE ]; then
rm $CONTROL_FILE
fi
find ./FHEM -type f \( ! -iname "0.*" \) -print0 | while IFS= read -r -d '' f;
do
out="UPD $(stat --format "%z %s" $f | sed -e "s#\([0-9-]*\)\ \([0-9:]*\)\.[0-9]*\ [+0-9]*#\1_\2#") $f"
echo "${out//.\//}" >> $CONTROL_FILE
done
#generate CHANGELOG
rm CHANGED
DATE=
git log --no-merges --pretty=format:'%ci|%s' | while read -r line; do
CDATE=$(echo "${line}" | awk '{print $1}')
MSG=$(echo "${line}" | awk -F '|' '{print $2}')
if [ "$DATE" != "$CDATE" ]; then
DATE=$CDATE
echo "$DATE" >> CHANGED
fi
echo " ${MSG}" >> CHANGED
done