summaryrefslogtreecommitdiff
path: root/plain.sh
diff options
context:
space:
mode:
authoreudoxia <uplink@distress.network>2020-12-13 21:49:05 -0500
committereudoxia <uplink@distress.network>2020-12-13 21:49:05 -0500
commit10b3951776a80d1f73676f87eade25c1c28d0cb7 (patch)
tree667d70d678633dfeba22fb9df3538c14ad412315 /plain.sh
parent0f3293ce2a9d9563087bb00b29db31aa1f06f961 (diff)
modified log formatting; slight usage instruction stylistic change
Diffstat (limited to 'plain.sh')
-rwxr-xr-xplain.sh12
1 files changed, 6 insertions, 6 deletions
diff --git a/plain.sh b/plain.sh
index f572701..79283be 100755
--- a/plain.sh
+++ b/plain.sh
@@ -24,14 +24,14 @@ OUT="$2"
[ "$1" ] || { echo "usage: ./plain.sh <input txt> <output html>" ; exit 1 ; }
-[ -f $IN ] || { echo "---- [FATAL] $IN not found ----" ; exit 1 ; }
-[ -f plain-header ] || { echo "---- [FATAL] plain-header not found ----" ; exit 1 ; }
+[ -f $IN ] || { printf "%s \tFATAL: %s not found\n" "[->]" "$IN" ; exit 1 ; }
+[ -f plain-header ] || { printf "%s \tFATAL: plain-header not found\n" "[->]" ; exit 1 ; }
cat plain-header > $2
cat $1 >> $2
printf "</pre>\n</body>\n</html>" >> $2
-echo '[ok] initial assembly'
+printf "[ok] \tinitial assembly\n"
# hack to fix double <pre> when generating from nav.sh
sed -e "/^<pre>$/ {n;/^<pre>$/d}" -e "/^<\/pre>$/ {n;/^<\/pre>$/d}" -i'' $2
@@ -43,11 +43,11 @@ sedesc() {
TITLE=$(grep -e '^<!--title: ' -m 1 $1 | cut -f 2- -d ' ' | sedesc)
sed -e "/^<!--title:/d" -e "s;<title>#;<title>${TITLE};1" -i'' $2
-printf '[ok] title: %s\n' "$TITLE"
+printf "[ok] \ttitle: %s\n" "$TITLE"
MDATE=$(stat -c '%y' $1 | sed -e 's/\.[0-9]* //' -e 's/\(..\)\(..\)$/\1:\2/') # ISO 8601 format: "yyyy-mm-dd hh:mm:ss±zz:zz"
sed "/^<\/head>/i <meta http-equiv=\"last-modified\" content=\"${MDATE}\" />" -i'' $2
-printf '[ok] date: %s\n' "$MDATE"
+printf "[ok] \tdate: %s\n" "$MDATE"
-echo "---- build complete: $2 ----"
+printf "%s \tbuild complete: %s\n" "[->]" "$2"