From a90eeec85067b6d0a19c9be69530eebed886da86 Mon Sep 17 00:00:00 2001 From: June McEnroe Date: Sat, 27 Jul 2019 17:00:47 -0400 Subject: Shell script style pass --- www/text.causal.agency/Makefile | 14 +++++++------- www/text.causal.agency/feed.sh | 39 ++++++++++++++++++++------------------- 2 files changed, 27 insertions(+), 26 deletions(-) mode change 100755 => 100644 www/text.causal.agency/feed.sh (limited to 'www') diff --git a/www/text.causal.agency/Makefile b/www/text.causal.agency/Makefile index 8f2a55a1..09076305 100644 --- a/www/text.causal.agency/Makefile +++ b/www/text.causal.agency/Makefile @@ -6,18 +6,18 @@ TXTS += 003-pleasant-c.txt TXTS += 004-uloc.txt TXTS += 005-testing-c.txt -all: $(TXTS) +all: ${TXTS} .SUFFIXES: .7 .txt .7.txt: - mandoc $< | col -b -x > $@ + mandoc $< | col -bx > $@ -feed.atom: $(TXTS) - ./feed.sh > feed.atom +feed.atom: feed.sh ${TXTS} + sh feed.sh > feed.atom clean: - rm -f $(TXTS) feed.atom + rm -f ${TXTS} feed.atom -install: $(TXTS) feed.atom - install -p -m 644 $(TXTS) feed.atom $(WEBROOT) +install: ${TXTS} feed.atom + install -p -m 644 ${TXTS} feed.atom ${WEBROOT} diff --git a/www/text.causal.agency/feed.sh b/www/text.causal.agency/feed.sh old mode 100755 new mode 100644 index 3c6e6589..21b1d4a3 --- a/www/text.causal.agency/feed.sh +++ b/www/text.causal.agency/feed.sh @@ -1,29 +1,30 @@ #!/bin/sh -set -e -u +set -eu updated=$(date -u '+%FT%TZ') -cat < - -Causal Agency -Junejune@causal.agency - -https://text.causal.agency/ -${updated} +cat <<- EOF + + + Causal Agency + Junejune@causal.agency + + https://text.causal.agency/ + ${updated} EOF for entry in *.7; do url="https://text.causal.agency/${entry%.7}.txt" title=$(grep '^\.Nm' "$entry" | cut -c 5-) summary=$(grep '^\.Nd' "$entry" | cut -c 5-) - updated=$(date -j -u -f '%s' "$(stat -f '%m' "$entry")" '+%FT%TZ') - cat < - ${title} - ${summary} - - ${url} - ${updated} - -EOF + mtime=$(stat -f '%m' "$entry") + updated=$(date -ju -f '%s' "$mtime" '+%FT%TZ') + cat <<- EOF + + ${title} + ${summary} + + ${url} + ${updated} + + EOF done echo '' -- cgit 1.4.1