From d367589abc50306a691a37fad881e3624ee140e9 Mon Sep 17 00:00:00 2001 From: Marko Date: Thu, 16 Nov 2023 21:03:35 +0100 Subject: [PATCH] fix: fix docs script (#18491) --- docs/pre.sh | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/docs/pre.sh b/docs/pre.sh index 42ae679f975a..fe41da35d06b 100755 --- a/docs/pre.sh +++ b/docs/pre.sh @@ -3,15 +3,17 @@ ## Create modules pages for D in ../x/*; do if [ -d "${D}" ]; then - 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" + DIR_NAME=$(echo $D | awk -F/ '{print $NF}') + MODDOC=docs/build/modules/$DIR_NAME + rm -rf $MODDOC + mkdir -p $MODDOC + if [ -f "$D/README.md" ]; then + cp -r $D/README.md $MODDOC/ fi fi done + ## Vesting is a submodule of auth, but we still want to display it in docs ## TODO to be removed in https://github.com/cosmos/cosmos-sdk/issues/9958 cp ../x/auth/vesting/README.md ./docs/build/modules/auth/1-vesting.md