From 7a032b7cdbb202d6e9e1bb4e5dd328b7812d83cd Mon Sep 17 00:00:00 2001 From: Jonathan Hodgson Date: Thu, 31 Dec 2020 16:57:47 +0000 Subject: [PATCH] 2 bug fixes - git not always working and verbose pandoc Pandoc would output warnings about a lack of title, although we are not using it in the template. Also, the tool would fail to do some git commands because it was checking the wrong folder --- inc/to-html | 2 +- kb | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/inc/to-html b/inc/to-html index c7eb870..3a29dbd 100644 --- a/inc/to-html +++ b/inc/to-html @@ -52,7 +52,7 @@ to-html(){ local newFile="${file##*/}" newFile="${newFile/.md/.html}" sed -E 's/\.md( *)\)/.html\1\)/' "$file" | - pandoc -f markdown -t html --template "$templateFile" > "$destination/$newFile" + pandoc --quiet -f markdown -t html --template "$templateFile" > "$destination/$newFile" done rsync -a \ diff --git a/kb b/kb index f5d8519..508be46 100755 --- a/kb +++ b/kb @@ -330,12 +330,14 @@ mainScript() { ############## Begin Script Here ################### #################################################### if [ "${args[0]}" != "init" ]; then - #cd "$dataDir" || return + olddir="$PWD" + cd "$dataDir" || return # Check to see if datadir is a git repo if ! git rev-parse 2> /dev/null; then # If not, ensure we don't run git commands dogit=0 fi + cd "$olddir" || return fi case "${args[0]}" in