forked from bahamas10/ysap
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmake-header
More file actions
executable file
·41 lines (33 loc) · 812 Bytes
/
Copy pathmake-header
File metadata and controls
executable file
·41 lines (33 loc) · 812 Bytes
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/usr/bin/env bash
#
# Print the colorized YSAP logo and metadata used as the header for all pages
# you can request via `curl`
#
# Author: Dave Eddy <dave@daveeddy.com>
# Date: March 17, 2024
# License: MIT
. ./theme || exit
. ./tools/repeat-char || exit
padding=1
while getopts 'p:' opt; do
case "$opt" in
p) padding=$OPTARG;;
*) exit 1;;
esac
done
padding=$(repeat-char ' ' "$padding")
mapfile -t logo < <(./make-logo)
description=(
""
"${COLOR5}You Suck at Programming$RST"
"${COLOR5}Episodes and guide by dave eddy$RST"
"${COLOR1}https://ysap.sh | https://daveeddy.com$RST"
''
"${COLOR5}Source: ${COLOR1}https://github.com/bahamas10/ysap$RST"
)
len=${#logo[@]}
for ((i = 0; i < len; i++)); do
logo_line=${logo[i]}
desc_line=${description[i]}
echo "$logo_line$padding$desc_line"
done