Better ##makedesc parsing
This commit is contained in:
parent
ad34d5c64a
commit
4a71dd0ae8
2
Makefile
2
Makefile
@ -1,4 +1,4 @@
|
|||||||
# Autogenerated at 04.07.2022 17:32 by ./gen-makefile.sh
|
# Autogenerated at 04.07.2022 19:08 using ./gen-makefile.sh
|
||||||
|
|
||||||
## apache: Install apache2 (latest)
|
## apache: Install apache2 (latest)
|
||||||
apache:
|
apache:
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
mv Makefile Makefile.bak
|
mv Makefile Makefile.bak
|
||||||
echo -e "# Autogenerated at $(date +'%d.%m.%Y %H:%M') by ${BASH_SOURCE[0]}\n" > Makefile
|
echo -e "# Autogenerated at $(date +'%d.%m.%Y %H:%M') using ${BASH_SOURCE[0]}\n" > Makefile
|
||||||
|
|
||||||
for file in ./install/*.sh; do
|
for file in ./install/*.sh; do
|
||||||
name=${file##*/}
|
name=${file##*/}
|
||||||
name=${name%.sh}
|
name=${name%.sh}
|
||||||
desc=$(cat ${file} | sed -n 2p | sed -n 's/^##makedesc: //p')
|
desc=$(grep -m 1 -oP "(?<=^##makedesc:\s).*$" ${file})
|
||||||
[ -z "$desc" ] && desc='<no description>'
|
[ -z "$desc" ] && desc='<no description>'
|
||||||
echo -e "## ${name}: ${desc}\n${name}:\n\t${file}\n" >> Makefile
|
echo -e "## ${name}: ${desc}\n${name}:\n\t${file}\n" >> Makefile
|
||||||
done;
|
done;
|
||||||
|
Loading…
Reference in New Issue
Block a user