From c52bd7b9c7d599e38db9670045d98a871a7d97a5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Astor?= Date: Thu, 16 Jan 2020 20:52:42 +0100 Subject: [PATCH] ensure mddir exists --- scripts/mdr2mdbook.sh | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/scripts/mdr2mdbook.sh b/scripts/mdr2mdbook.sh index a537d6d1..52da77e1 100644 --- a/scripts/mdr2mdbook.sh +++ b/scripts/mdr2mdbook.sh @@ -1,3 +1,4 @@ +#!/bin/sh footer() { cat << EOF @@ -37,10 +38,11 @@ runall() { done } - if [[ "$1" == *".mdr" ]] - then doc2src $1 - if [ "$(git status -s | grep docs)" ] - then sh scripts/summary.sh > md/SUMMARY.md - fi - else runall - fi +ensure_dir "$(dirname $1)" +if [[ "$1" == *".mdr" ]] +then doc2src $1 +if [ "$(git status -s | grep docs)" ] +then sh scripts/summary.sh > md/SUMMARY.md +fi +else runall +fi -- 2.43.0