Improve site directory validation by checking for at least one file.

This commit is contained in:
Marcelo Prates
2025-05-16 22:13:37 -03:00
parent 0f02bc4a06
commit d2d31dd803

View File

@@ -42,8 +42,8 @@ jobs:
git checkout --orphan site-artifact
# Remove everything except .git
find . -mindepth 1 ! -regex '^./.git\(/.*\)?' -delete
# Check if site/ exists and is not empty
if [ ! -d site ] || [ -z "$(ls -A site)" ]; then
# Check if site/ exists and contains at least one file
if [ ! -d site ] || [ "$(find site -type f | wc -l)" -eq 0 ]; then
echo "site/ directory does not exist or is empty. MkDocs build may have failed."
exit 1
fi