diff options
author | Andre Miranda <andreldm@xfce.org> | 2020-07-09 20:10:01 -0300 |
---|---|---|
committer | Andre Miranda <andreldm@xfce.org> | 2020-07-09 20:42:08 -0300 |
commit | 3412f9b7d22490792707e7aecb1c06a4bf8f27e8 (patch) | |
tree | 30a16a449b528ce141b52e7f5121dd9a7768d033 | |
parent | 796174773bde6d16790e5b48e2403747345c1a0d (diff) | |
download | xfce4-dev-tools-3412f9b7d22490792707e7aecb1c06a4bf8f27e8.tar.gz |
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.
-rwxr-xr-x | helpers/xfce-update-news | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/helpers/xfce-update-news b/helpers/xfce-update-news index 42173b1..cc266ca 100755 --- a/helpers/xfce-update-news +++ b/helpers/xfce-update-news @@ -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 |