Skip to content

Commit ae32f2f

Browse files
committed
Fix shell script formatting in generate-logo.sh
Change all function definitions to K&R style (opening brace on same line) to comply with shfmt formatting requirements in CI. The CI uses 'shfmt -i 4 -bn -ci -sr' which defaults to K&R style (no -fn flag), requiring function opening braces on the same line as the function name. Fixed functions: - extract_ascii_art() - detect_imagemagick() - detect_font() - generate_png() - usage() - main()
1 parent bff6c23 commit ae32f2f

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

scripts/generate-logo.sh

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@ CANVAS_WIDTH=1600
3131
MIN_LINES=10
3232

3333
# Extract ASCII art from README.md comment block
34-
extract_ascii_art()
35-
{
34+
extract_ascii_art() {
3635
if [[ ! -f "$README" ]]; then
3736
echo "Error: README.md not found at $README" >&2
3837
return 1
@@ -63,8 +62,7 @@ extract_ascii_art()
6362
}
6463

6564
# Detect available ImageMagick command
66-
detect_imagemagick()
67-
{
65+
detect_imagemagick() {
6866
if command -v magick &> /dev/null; then
6967
echo "magick"
7068
elif command -v convert &> /dev/null; then
@@ -75,8 +73,7 @@ detect_imagemagick()
7573
}
7674

7775
# Detect available font from preference list
78-
detect_font()
79-
{
76+
detect_font() {
8077
local available_fonts
8178
available_fonts=$(magick -list font 2> /dev/null | grep -i "Font:" | awk '{print $2}' || echo "")
8279

@@ -92,8 +89,7 @@ detect_font()
9289
}
9390

9491
# Generate PNG using ImageMagick
95-
generate_png()
96-
{
92+
generate_png() {
9793
local ascii_art="$1"
9894

9995
# Detect ImageMagick command
@@ -156,8 +152,7 @@ generate_png()
156152
}
157153

158154
# Display usage information
159-
usage()
160-
{
155+
usage() {
161156
cat << EOF
162157
Usage: $(basename "$0") [OPTIONS]
163158
@@ -179,8 +174,7 @@ EOF
179174
}
180175

181176
# Main execution
182-
main()
183-
{
177+
main() {
184178
# Parse command line arguments
185179
while [[ $# -gt 0 ]]; do
186180
case "$1" in

0 commit comments

Comments
 (0)