Various syntax and style fixes in gopher and gemini routines

This commit is contained in:
~nytpu 2020-05-26 18:56:47 -04:00
parent a2b7f9e513
commit 5f93c05f07
1 changed files with 7 additions and 7 deletions

14
bb.sh
View File

@ -863,17 +863,17 @@ make_gophermap() {
ln -s "${HOME}/public_html/blog/" "${HOME}/public_gopher/blog" ln -s "${HOME}/public_html/blog/" "${HOME}/public_gopher/blog"
fi fi
if [ ! -f "${HOME}/public_gopher/blog/gophermap" ]; then if [ ! -f "${HOME}/public_gopher/blog/$gophermap" ]; then
cat <<- 'EOF' > $HOME/public_html/blog/gophermap cat <<- 'EOF' > $HOME/public_html/blog/$gophermap
#!/bin/bash #!/usr/bin/env sh
echo -e "my bashblog posts\n" printf "my bashblog posts\n"
user=$(stat -c '%U' .) user=$(stat -c '%U' .)
for post in $(ls -t *.md); do for post in $(ls -t *.md); do
post=$(basename $post) post=$(basename $post)
echo -e "0$post\t/~$user/blog/$post\ttilde.team\t70" printf "0$post\t/~$user/blog/$post\ttilde.team\t70\n"
done done
EOF EOF
chmod +x $HOME/public_html/blog/gophermap chmod +x $HOME/public_html/blog/$gophermap
fi fi
chmod 644 *.md chmod 644 *.md
} }
@ -890,7 +890,7 @@ make_gemini() {
if [ ! -f "${HOME}/public_gemini/blog/$gemini_index" ]; then if [ ! -f "${HOME}/public_gemini/blog/$gemini_index" ]; then
cat <<- 'EOF' > $HOME/public_gemini/blog/$gemini_index cat <<- 'EOF' > $HOME/public_gemini/blog/$gemini_index
#!/bin/bash #!/usr/bin/env sh
printf "20 text/gemini\r\n" printf "20 text/gemini\r\n"
printf "my bashblog posts\r\n" printf "my bashblog posts\r\n"
user=$(stat -c '%U' $0) user=$(stat -c '%U' $0)