From 2e48b8e545cddef34c4458f8592b4f2f52dd4e75 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Thu, 16 Nov 2023 15:53:50 +0100 Subject: [PATCH] docs: avoid copying non existent files & counter readme (backport #18487) (#18490) Co-authored-by: Marko --- docs/pre.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/docs/pre.sh b/docs/pre.sh index 1db9268e8ca0..42ae679f975a 100755 --- a/docs/pre.sh +++ b/docs/pre.sh @@ -3,9 +3,12 @@ ## Create modules pages for D in ../x/*; do if [ -d "${D}" ]; then - MODDOC=docs/build/modules/$(echo $D | awk -F/ '{print $NF}') - rm -rf $MODDOC - mkdir -p $MODDOC && cp -r $D/README.md "$_" + MODULE_DIRECTORY=docs/build/modules/$DIR_NAME + rm -rf "$MODULE_DIRECTORY" + mkdir -p "$MODULE_DIRECTORY" + if [ -f "$D"/README.md ]; then + cp -r "$D"/README.md "$MODULE_DIRECTORY" + fi fi done