From 2193ca202d33fe4bdecf1249dc724b69f01d36f3 Mon Sep 17 00:00:00 2001 From: "Glenn Y. Rolland" Date: Sun, 27 Jun 2021 23:44:08 +0200 Subject: [PATCH] fix: Make sure watch works for tocupdate target --- Makefile | 4 ++-- Procfile | 2 +- scripts/update-toc | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index d38a20d..884d671 100755 --- a/Makefile +++ b/Makefile @@ -93,9 +93,9 @@ watch: ## run development server watch-tocupdate-internal: while inotifywait -q -e move -e modify -e create -e attrib -e delete -e moved_to -r docs ; do \ - sleep 0.2 ; \ + sleep 2 ; \ $(MAKE) images ; \ - pipenv run ./scripts/update-toc $(DOCS_DIR) ; \ + $(MAKE) tocupdate ; \ done watch-docs-internal: diff --git a/Procfile b/Procfile index 6cdcfd9..66e96d9 100644 --- a/Procfile +++ b/Procfile @@ -1,3 +1,3 @@ docs: make watch-docs-internal slides: make watch-slides-internal -toc: make tocupdate +toc: make watch-tocupdate-internal diff --git a/scripts/update-toc b/scripts/update-toc index e8c5b9e..82097b3 100755 --- a/scripts/update-toc +++ b/scripts/update-toc @@ -83,7 +83,7 @@ class TocBuilder: bname_split = os.path.splitext(bname) dname = os.path.dirname(f) - if lastdir != dname: + if lastdir != dname and dname != "": lastdir = dname title = self.__get_title(os.path.join(self.root_path, dname, 'index.md')) if title is not None: