From efa1e0353ebbefffee882ee2f2ef7652c221edcb Mon Sep 17 00:00:00 2001 From: mfahampshire Date: Fri, 11 Aug 2023 12:29:30 +0200 Subject: [PATCH] rough staging sh script --- documentation/staging.sh | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100755 documentation/staging.sh diff --git a/documentation/staging.sh b/documentation/staging.sh new file mode 100755 index 0000000000..07ca2de1d2 --- /dev/null +++ b/documentation/staging.sh @@ -0,0 +1,35 @@ +#!/bin/bash + +# commands assume you run script from `nym/documentation/` + +# array of project dirs +declare -a projects=("docs" "dev-portal" "operators") + +## now loop through the above array +for i in "${projects[@]}" +do + # cd to project dir + cd "./$i" && + # little sanity checks + echo $(pwd) && echo $(mdbook --version) && + # clean old book + rm -rf ./book/ + # build book + mdbook build + # check for destination, if ! then mkdir & check again else echo thumbs up + if [ ! -d ../../dist/docs/$i ]; then + echo "dest doesn't exist: creating dir" + mkdir -p ../../dist/docs/$i + fi + if [ -d ../../dist/docs/$i ]; then + echo "cp destination exists, all good" + fi + # clean old dist/$i + rm -rf ../../dist/docs/$i + # move newly rendered book/ to dist + cp -r ./book/ ../../dist/docs/$i + # sanity check + ls -a ../../dist/docs/$i/html + # cd back to ../documentation/ + cd ../ +done \ No newline at end of file