From 44864038114355cd73074c2d41a86f9d14ac3aa5 Mon Sep 17 00:00:00 2001 From: marbar3778 Date: Thu, 16 Nov 2023 15:12:23 +0100 Subject: [PATCH 1/4] avoid counter and other missing readmes in script --- docs/pre.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/docs/pre.sh b/docs/pre.sh index 2c7081f45c32..fc779d58e110 100755 --- a/docs/pre.sh +++ b/docs/pre.sh @@ -3,9 +3,14 @@ ## Create modules pages for D in ../x/*; do if [ -d "${D}" ]; then - MODDOC=build/modules/$(echo $D | awk -F/ '{print $NF}') - rm -rf $MODDOC - mkdir -p $MODDOC && cp -r $D/README.md "$_" + DIR_NAME=$(echo $D | awk -F/ '{print $NF}') + + # Skip specific directories + if [ "$DIR_NAME" != "counter" ] && [ "$DIR_NAME" != "tx" ] && [ "$DIR_NAME" != "simulation" ]; then + MODDOC=build/modules/$DIR_NAME + rm -rf $MODDOC + mkdir -p $MODDOC && cp -r $D/README.md "$_" + fi fi done From 09a113c77a4ad7fcd1c61eb6a5ff011c504601a6 Mon Sep 17 00:00:00 2001 From: marbar3778 Date: Thu, 16 Nov 2023 15:21:04 +0100 Subject: [PATCH 2/4] coderabbit --- docs/pre.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/pre.sh b/docs/pre.sh index fc779d58e110..40309977e0dc 100755 --- a/docs/pre.sh +++ b/docs/pre.sh @@ -3,13 +3,13 @@ ## Create modules pages for D in ../x/*; do if [ -d "${D}" ]; then - DIR_NAME=$(echo $D | awk -F/ '{print $NF}') + DIR_NAME=$(basename "$D") # Skip specific directories - if [ "$DIR_NAME" != "counter" ] && [ "$DIR_NAME" != "tx" ] && [ "$DIR_NAME" != "simulation" ]; then - MODDOC=build/modules/$DIR_NAME - rm -rf $MODDOC - mkdir -p $MODDOC && cp -r $D/README.md "$_" + if [[ "$DIR_NAME" != "counter" && "$DIR_NAME" != "tx" && "$DIR_NAME" != "simulation" ]]; then + MODULE_DIRECTORY=build/modules/$DIR_NAME + rm -rf "$MODULE_DIRECTORY" + mkdir -p "$MODULE_DIRECTORY" && cp -r "$D"/README.md "$MODULE_DIRECTORY" fi fi done From dd68d48bb0b6b77563b050d035fb7e74a8e0844a Mon Sep 17 00:00:00 2001 From: marbar3778 Date: Thu, 16 Nov 2023 15:25:20 +0100 Subject: [PATCH 3/4] coderabbit --- docs/pre.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/pre.sh b/docs/pre.sh index 40309977e0dc..468a2125ec9d 100755 --- a/docs/pre.sh +++ b/docs/pre.sh @@ -5,11 +5,11 @@ for D in ../x/*; do if [ -d "${D}" ]; then DIR_NAME=$(basename "$D") - # Skip specific directories - if [[ "$DIR_NAME" != "counter" && "$DIR_NAME" != "tx" && "$DIR_NAME" != "simulation" ]]; then - MODULE_DIRECTORY=build/modules/$DIR_NAME - rm -rf "$MODULE_DIRECTORY" - mkdir -p "$MODULE_DIRECTORY" && cp -r "$D"/README.md "$MODULE_DIRECTORY" + MODULE_DIRECTORY=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 From 9103455b345dbeeccd896aaf372cf7d7b2907ae0 Mon Sep 17 00:00:00 2001 From: marbar3778 Date: Thu, 16 Nov 2023 15:29:10 +0100 Subject: [PATCH 4/4] almost missed it --- docs/pre.sh | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/docs/pre.sh b/docs/pre.sh index 468a2125ec9d..622c3cd6d363 100755 --- a/docs/pre.sh +++ b/docs/pre.sh @@ -5,11 +5,14 @@ for D in ../x/*; do if [ -d "${D}" ]; then DIR_NAME=$(basename "$D") - MODULE_DIRECTORY=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" + # Skip specific directories + if [[ "$DIR_NAME" != "counter" ]]; then + MODULE_DIRECTORY=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 fi done