pve-eslint/debian/scripts/prepare-changes.sh
Thomas Lamprecht 604f8c2abf d/scripts: trim build and jenkins too
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-12-06 14:14:27 +01:00

36 lines
729 B
Bash
Executable File

#!/bin/bash
set -eu -o pipefail
if [[ $1 =~ ^-(h|-help)$ ]]; then
echo "usage: $0 [<FROM-VERSION>]"
echo ""
echo "Filter out irrelevant entries (sponsors, chore, docs) from the upstream changelog."
exit 0
fi
repo="$(git rev-parse --show-toplevel)"
cfn="$repo/changes.new.tmp"
cp "$repo/eslint/CHANGELOG.md" "$cfn"
sed -ri 's/^\* \S+ /+ /g' "$cfn"
sed -i '/ Sponsors: /Id' "$cfn"
sed -i '/ Chore: /Id' "$cfn"
sed -i '/ Docs: /Id' "$cfn"
sed -i '/ ci: /Id' "$cfn"
sed -i '/ build: /Id' "$cfn"
sed -i '/ESLint Jenkins/Id' "$cfn"
if [[ $1 ]]; then
version="$1"
sed -i "/^$version -/Q" "$cfn"
sed -i '/^\+ /!d' "$cfn"
fi
mv "$cfn" "$repo/changes"
echo "trimmed changes available at '$repo/changes'"