pyratelog

personal blog
git clone git://git.pyratebeard.net/pyratelog.git
Log | Files | Refs | README

commit 03d1387a12244b8ce12c96388458156c3278652b
parent 0bee6e2e566a29699d099a34ee89fecaf1cd1d6c
Author: pyratebeard <root@pyratebeard.net>
Date:   Wed,  3 Mar 2021 12:06:32 +0000

fixed dir monitoring

use continue(1P) instead of amend(1P) so we're not breaking out of the function. change how sleep occurs

Diffstat:
Mpyratelog.sh | 5+++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/pyratelog.sh b/pyratelog.sh @@ -25,7 +25,7 @@ function initialise() { input_link="<li><a class='index' href='entry/${input}.html'><b>${index_date}</b> ${index_title}</a></li>" # if link already exists we can stop - grep ${input} index.html >/dev/null && return + grep ${input} index.html >/dev/null && continue # for new files we turn the markdown into html # using a template file @@ -50,5 +50,6 @@ function initialise() { # watch the entry directory for new files while : ; do - ls ./entry/*.md >/dev/null 2>&1 && initialise || sleep 30 + ls ./entry/*.md >/dev/null 2>&1 && initialise + sleep 30 done