~skiqqy/gwiki

822640f2da50ebc9389a159f05a43218d99eb721 — Stephen Cochrane 2 months ago 825fe8d
Added times to print, for better logging.
1 files changed, 7 insertions(+), 4 deletions(-)

M entry.sh
M entry.sh => entry.sh +7 -4
@@ 56,6 56,7 @@ watch()
	# Main event loop.
	while true
	do
		printf '%s (Re)starting event loop for %s\n' "$(date '+[ %e/%m/%Y %X ]')" "$wdir"
		build=false

		if git_behind


@@ 67,17 68,19 @@ watch()
		# Build if we have to.
		if "$build"
		then
			printf 'Rebuilding %s' "$wdir"
			printf '[ DISK IO ] %s Rebuilding %s\n' "$(date '+[ %e/%m/%Y %X ]')" "$wdir"
			make         # Try make
			mkdocs build # Try mkdocs
		fi

		# check Max depth reached (wikis dont have nested wikis, except for root wiki)
		[ ! "$wdir" = "$root" ] && popd && return
		[ ! "$wdir" = "$root" ] && popd && \
			printf '%s Exiting event loop for %s\n' "$(date '+[ %e/%m/%Y %X ]')" "$wdir" && \
			return

		# check children. IE Recursion.
		[ ! -f config ] && printf 'SEVERE: MISSING CONFIG FILE.\n'
		. config
		[ ! -f config ] && printf 'WARN: %s/config missing.\n' "$wdir"
		[ -f config ] && . config

		for wiki in "${wikis[@]}"
		do