From 7d8cf43383edc6fbd616b19733af6f8b2fcbf68d Mon Sep 17 00:00:00 2001 From: Martin Rotter Date: Thu, 4 Apr 2019 07:44:25 +0200 Subject: [PATCH] hook --- .../desktop/com.github.rssguard.appdata.xml | 5 ++--- resources/scripts/hooks/pre-commit | 16 ++++++++++++++++ 2 files changed, 18 insertions(+), 3 deletions(-) create mode 100644 resources/scripts/hooks/pre-commit diff --git a/resources/desktop/com.github.rssguard.appdata.xml b/resources/desktop/com.github.rssguard.appdata.xml index c5213da72..02064b8e1 100755 --- a/resources/desktop/com.github.rssguard.appdata.xml +++ b/resources/desktop/com.github.rssguard.appdata.xml @@ -30,7 +30,7 @@ https://martinrotter.github.io/donate/ - +

Fixed:

    @@ -42,8 +42,7 @@
- - +
rssguard diff --git a/resources/scripts/hooks/pre-commit b/resources/scripts/hooks/pre-commit new file mode 100644 index 000000000..6e3d1cd53 --- /dev/null +++ b/resources/scripts/hooks/pre-commit @@ -0,0 +1,16 @@ +#!/bin/sh + +set -- resources/desktop/*.appdata.xml +appdata_file="$1" +appdata_file_n="${1}.n" +changelog_file="resources/text/CHANGELOG" + +# Set version and date. +datestring="$(date +%F)" +versionstring="$(head -n 1 "$changelog_file")" + +cat "$appdata_file" | sed -e "s@release version\=\"[A-Za-z0-9.]*\"@release version\=\"$versionstring\"@g" | sed -e "s@ date\=\"[0-9\-]*\"@ date\=\"$datestring\"@g" > "$appdata_file_n" +mv "$appdata_file_n" "$appdata_file" + +git add "$appdata_file" +exit 0 \ No newline at end of file