make docs workflow more resilient
@@ -62,14 +62,15 @@ else
echo "Updating the docs..."
# remove everything in the previous docs/ folder, except versioned_docs/*, versioned_sidebars/*
# and versions.js files.
- cd $TMP_DOCS_FOLDER/docs/ && find . ! -path . ! -regex '.*version.*' -exec rm -rf {} + && cd -
+ # skip node_modules/ because `yarn install` has run
+ cd $TMP_DOCS_FOLDER/docs/ && find . ! -path . ! -regex '.*\(version\|node_modules\).*' -exec rm -rf {} + && cd - || exit 1
# update the docs/ folder with the latest version of the docs
cp -R `ls -A | grep -v "^\.git$"` $TMP_DOCS_FOLDER/
if [ ! -z "$NEW_VERSION" ]
then
echo "Generating docs for new version $NEW_VERSION..."
- cd $TMP_DOCS_FOLDER/docs && yarn run new-version $NEW_VERSION && cd -
+ cd $TMP_DOCS_FOLDER/docs && yarn run new-version $NEW_VERSION && cd - || exit 1
fi
fi
