diff options
Diffstat (limited to 'plain.sh')
-rwxr-xr-x | plain.sh | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -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" |