Skip to content

Commit cc27d98

Browse files
fix: skip template documentation generation if source files do not exist (#87)
Signed-off-by: Michael Valdron <[email protected]>
1 parent aa69bf4 commit cc27d98

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

scripts/util

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,18 @@ function apply-configurations() {
1010
SAMPLENAME=$2
1111
TEMPLATE_TECHDOC_TYPE=$3
1212

13-
cp -r $ROOT_DIR/documentation/$TEMPLATE_TECHDOC_TYPE/$SAMPLENAME $DEST/docs
14-
cp -r $ROOT_DIR/documentation/$TEMPLATE_TECHDOC_TYPE/mkdocs.yml $DEST/mkdocs.yml
15-
cp $ROOT_DIR/documentation/$TEMPLATE_TECHDOC_TYPE/template-prerequisites.md $DEST/docs/template-prerequisites.md
13+
DOC_SRC_ROOT="$ROOT_DIR/documentation/$TEMPLATE_TECHDOC_TYPE"
14+
SAMPLE_DOC_SRC="$DOC_SRC_ROOT/$SAMPLENAME"
15+
PREREQ_DOC_SRC="$DOC_SRC_ROOT/template-prerequisites.md"
16+
if [ -d $DOC_SRC_ROOT ]; then
17+
if [ -d $SAMPLE_DOC_SRC ]; then
18+
cp -r $SAMPLE_DOC_SRC $DEST/docs
19+
if [ -f $PREREQ_DOC_SRC ]; then
20+
cp $PREREQ_DOC_SRC $DEST/docs/template-prerequisites.md
21+
fi
22+
fi
23+
cp -r $DOC_SRC_ROOT/mkdocs.yml $DEST/mkdocs.yml
24+
fi
1625

1726
cp $SKELETON_DIR/template.yaml $DEST/template.yaml
1827

0 commit comments

Comments
 (0)