Skip to content
Snippets Groups Projects
Commit 3412f9b7 authored by Andre Miranda's avatar Andre Miranda
Browse files

helpers: Simplify xfce-update-news

In my tests this works fine, unless I'm missing something
I don't see a reason for writing to files.
parent 79617477
No related branches found
No related tags found
1 merge request!28Helpers improvements
......@@ -3,28 +3,17 @@
COMPONENT=$1
VERSION=$2
WRITE_TAG=$3
LAST_TAG=$(git describe --abbrev=0)
RELEASE_NOTES="/tmp/release_notes"
TRANSLATIONS="/tmp/translations"
# Push the release notes and translations text to tmp files
xfce-get-release-notes $LAST_TAG silent > $RELEASE_NOTES
xfce-get-translations "$LAST_TAG" "HEAD" silent > $TRANSLATIONS
cleanup () {
rm $RELEASE_NOTES
rm $TRANSLATIONS
}
LAST_TAG=$(git describe --abbrev=0)
RELEASE_NOTES=$(xfce-get-release-notes "$LAST_TAG" silent)
TRANSLATIONS=$(xfce-get-translations "$LAST_TAG" "HEAD" silent)
# Check if there is a NEWS file
if [ "$WRITE_TAG" = "WRITETAG" ]; then
printf '%s\n\n%s\n%s\n' $VERSION "$(cat $RELEASE_NOTES)" "$(cat $TRANSLATIONS)"
printf '%s\n\n%s\n%s\n' $VERSION "$RELEASE_NOTES" "$TRANSLATIONS"
elif [ ! -f "NEWS" ]; then
echo "There is no 'NEWS' file. Changelog since $VERSION:"
printf '%s\n======\n%s\n%s\n\n%s' $VERSION "$(cat $RELEASE_NOTES)" "$(cat $TRANSLATIONS)"
cleanup
printf '%s\n======\n%s\n%s\n\n%s' $VERSION "$RELEASE_NOTES" "$TRANSLATIONS"
else
printf '%s\n======\n%s\n%s\n\n%s\n' $VERSION "$(cat $RELEASE_NOTES)" "$(cat $TRANSLATIONS)" "$(cat NEWS)" > NEWS
cleanup
printf '%s\n======\n%s\n%s\n\n%s\n' $VERSION "$RELEASE_NOTES" "$TRANSLATIONS" "$(cat NEWS)" > NEWS
git diff NEWS
fi
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment