Skip to content

Commit 2c66181

Browse files
committed
Fix README ignored by index generation
1 parent 88f06c5 commit 2c66181

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

script/makedocs.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,15 @@ DST=${WORKSPACE%/}/${RELATIVE_DST}
2424
TMP_DST=/tmp/makedocs
2525
echo "Source: ${SRC}; Destination: ${DST}"
2626
# Generate index if absent
27-
if [ ! -f "${SRC}/index.md" ] ; then
27+
if [ ! -f "${SRC}/index.md" -a ! -f "${SRC}/README.md" ] ; then
2828
echo "Index file (index.md) not found. It will be created using a script..."
2929
echo "# ${REPOSITORY}" > "${SRC}/index.md"
3030
CLEAN_INDEX=true
3131
fi
3232
# Copy static template files
3333
export SRC_THEME="${SRC}/theme"
3434
mkdir -p "${SRC_THEME}" && cp -f /usr/local/src/theme.main.html "${SRC_THEME}/main.html"
35+
CLEAN_THEME=true
3536
# Convert docs to temp folder
3637
mkdocs build -c -f /usr/local/src/mkdocs.yml -d "${TMP_DST}"
3738
# Copy static assets to be added
@@ -44,3 +45,6 @@ mv -f "${TMP_DST}" "${DST}"
4445
if [ "${CLEAN_INDEX}" = true ] ; then
4546
rm "${SRC}/index.md"
4647
fi
48+
if [ "${CLEAN_THEME}" = true ] ; then
49+
rm -rf "${SRC_THEME}"
50+
fi

0 commit comments

Comments
 (0)