1+ #! /bin/bash
2+
3+ #
4+ # Supermodel
5+ # A Sega Model 3 Arcade Emulator.
6+ # Copyright 2003-2025 The Supermodel Team
7+ #
8+ # This file is part of Supermodel.
9+ #
10+ # Supermodel is free software: you can redistribute it and/or modify it under
11+ # the terms of the GNU General Public License as published by the Free
12+ # Software Foundation, either version 3 of the License, or (at your option)
13+ # any later version.
14+ #
15+ # Supermodel is distributed in the hope that it will be useful, but WITHOUT
16+ # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
17+ # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
18+ # more details.
19+ #
20+ # You should have received a copy of the GNU General Public License along
21+ # with Supermodel. If not, see <http://www.gnu.org/licenses/>.
22+ #
23+
24+ #
25+ # changelog.sh
26+ #
27+ # Produces a change log (i.e., CHANGES.txt attached with each release). Takes a
28+ # single command line argument, which is the file path.
29+ #
30+
31+ #! /bin/bash
32+
33+ # Check if file path argument is provided
34+ if [ $# -ne 1 ]; then
35+ echo " Error: Please provide a file path as an argument" >&2
36+ echo " Usage: $0 <output_file_path>" >&2
37+ exit 1
38+ fi
39+
40+ OUTPUT_FILE=" $1 "
41+ FROM_REF=${FROM_REF:- 06594a5}
42+ REF=${REF:- $(git rev-parse --short HEAD)}
43+
44+ # Write header directly to output file
45+ cat << EOF > "${OUTPUT_FILE} "
46+
47+ #### ### ###
48+ ## ## ## ##
49+ ### ## ## ## ### #### ## ### ## ## #### ## #### ##
50+ ### ## ## ## ## ## ## ### ## ####### ## ## ##### ## ## ##
51+ ### ## ## ## ## ###### ## ## ####### ## ## ## ## ###### ##
52+ ## ## ## ## ##### ## ## ## # ## ## ## ## ## ## ##
53+ #### ### ## ## #### #### ## ## #### ### ## #### ####
54+ ####
55+
56+ A Sega Model 3 Arcade Emulator.
57+
58+ Copyright 2003-2025 The Supermodel Team
59+
60+ CHANGE LOG
61+
62+ EOF
63+
64+ # Append git log directly to output file
65+ if ! git -c color.ui=never log ${FROM_REF} ...${REF} --no-decorate --format=format:" Commit %h on %ad by %an%n%n%w(80,4,4)%B" --date=short >> " ${OUTPUT_FILE} " ; then
66+ echo " Unable to obtain Git log" >&2
67+ exit 1
68+ fi
0 commit comments