summaryrefslogtreecommitdiff
path: root/tools/collect-changelog
blob: 1e12d5640e235fc05e7f804188d7aa5a541625af (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/sh

collectType() {
    local suffix="$1"
    local header="$2"
    local printed=0
    for file in changelog.d/*."$suffix"; do
        if [ '!' -f "$file" ]; then
            continue
        fi
        if [ "$printed" = 0 ]; then
            echo
            echo "### $header"
            printed=1
        fi
        # Normalize any trailing newlines/spaces, etc.
        echo "- $(cat "$file")"
    done
}

collectType security Security
collectType change Changed
collectType add Added
collectType fix Fixed
collectType remove Removed

rm changelog.d/*