Skip to content

Commit

Permalink
chore(build): Always ignore reference docs on flag set.
Browse files Browse the repository at this point in the history
Even if the reference source directory exists, it takes a long time to copy the files. Deleting this directory is not preferable since the generation toime is also long. Therefore, setting the flag will now always skip reference file copying on the BUILD_DOCS_DEV variable being set.
  • Loading branch information
costleya committed Nov 15, 2018
1 parent 3cc2fff commit 1409a6d
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions docs/build-docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,22 +59,24 @@ echo "Copying generated reference documentation..."
rm -fr ${refdocsdir}/
mkdir -p ${refdocsdir}

if [ ! -d "${refsrc}" ]; then
echo "Cannot find ${refsrc} in the root directory of this repo"
echo "Did you run ./pack.sh?"

if [ -z "${BUILD_DOCS_DEV:-}" ]; then
echo "Cannot build docs without reference. Set BUILD_DOCS_DEV=1 to allow this for development purposes"
exit 1
if [ -z "${BUILD_DOCS_DEV:-}" ]; then
if [ ! -d "${refsrc}" ]; then
echo "Cannot find ${refsrc} in the root directory of this repo"
echo "Did you run ./pack.sh?"

if [ -z "${BUILD_DOCS_DEV:-}" ]; then
echo "Cannot build docs without reference. Set BUILD_DOCS_DEV=1 to allow this for development purposes"
exit 1
fi
else
echo "BUILD_DOCS_DEV is set, continuing without reference documentation..."
rsync -av ${refsrc}/ ${refdocsdir}/

echo "Generating reference docs toctree under ${refs_index}..."
cat ${refs_index}.template > ${refs_index}
ls -1 ${refdocsdir} | grep '.rst$' | sed -e 's/\.rst//' | sort | xargs -I{} echo " ${refdocs}/{}" >> ${refs_index}
fi
else
rsync -av ${refsrc}/ ${refdocsdir}/

echo "Generating reference docs toctree under ${refs_index}..."
cat ${refs_index}.template > ${refs_index}
ls -1 ${refdocsdir} | grep '.rst$' | sed -e 's/\.rst//' | sort | xargs -I{} echo " ${refdocs}/{}" >> ${refs_index}
echo "BUILD_DOCS_DEV is set, continuing without reference documentation..."
fi

export CDK_VERSION=$(../tools/pkgtools/bin/cdk-version)
Expand Down

0 comments on commit 1409a6d

Please sign in to comment.