Print Username, if present
This commit is contained in:
parent
4ef53d20e6
commit
81b29b5eeb
1 changed files with 14 additions and 4 deletions
14
update.sh
14
update.sh
|
@ -10,14 +10,24 @@ echo "# Rofi Themes: " >> README.md
|
||||||
echo "Below a list of user contributed **rofi** themes." >> README.md
|
echo "Below a list of user contributed **rofi** themes." >> README.md
|
||||||
echo "" >> README.md
|
echo "" >> README.md
|
||||||
|
|
||||||
|
getAuthor() {
|
||||||
|
awk '/User: / { print $3 }' "${a}"
|
||||||
|
}
|
||||||
|
|
||||||
THEMES=( $(ls Themes/*.theme) )
|
THEMES=( $(ls Themes/*.theme) )
|
||||||
for a in ${THEMES[@]}
|
for a in ${THEMES[@]}
|
||||||
do
|
do
|
||||||
FILE=$(basename $a)
|
FILE=$(basename $a)
|
||||||
|
STRIPPED=$(grep -vwE "User:" "${a}")
|
||||||
echo "File: ${FILE}"
|
echo "File: ${FILE}"
|
||||||
NAME=${FILE%.theme}
|
NAME=${FILE%.theme}
|
||||||
IMAGE="Screenshots/${NAME}.png"
|
IMAGE="Screenshots/${NAME}.png"
|
||||||
echo "# ${NAME}" >> README.md
|
AUTHOR=$(getAuthor)
|
||||||
|
echo "# ${FILE}" >> README.md
|
||||||
|
if [ -n ${AUTHOR} ];
|
||||||
|
then
|
||||||
|
echo "by ${AUTHOR}" >> README.md
|
||||||
|
fi
|
||||||
echo "" >> README.md
|
echo "" >> README.md
|
||||||
if [ ${a} -nt ${IMAGE} ]
|
if [ ${a} -nt ${IMAGE} ]
|
||||||
then
|
then
|
||||||
|
@ -32,7 +42,7 @@ do
|
||||||
echo "## XResources" >> README.md
|
echo "## XResources" >> README.md
|
||||||
echo "" >> README.md
|
echo "" >> README.md
|
||||||
echo "~~~" >> README.md
|
echo "~~~" >> README.md
|
||||||
cat "${a}" >> README.md
|
echo "${STRIPPED}" >> README.md
|
||||||
echo "~~~" >> README.md
|
echo "~~~" >> README.md
|
||||||
echo "" >> README.md
|
echo "" >> README.md
|
||||||
done
|
done
|
||||||
|
|
Loading…
Reference in a new issue