complex-docs/utils/doc-build/build.sh

31 lines
724 B
Bash
Raw Normal View History

2024-04-23 20:34:59 +03:00
#!/bin/bash
if [ ! -d "docs/" ]; then
echo "Error: No docs/ directory found!" >&2
exit 1
fi
if [ -d "build/" ]; then
rm -r "build/"
fi
mkdir build/
for i in docs/*; do
TARGET_FOLDER=build/txt/$(echo $i | sed 's/docs\///g')
echo "--- Generating $TARGET_FOLDER..."
mkdir -p $TARGET_FOLDER;
for j in $(find $i -name "complex-*.txt" -type f | sort); do
echo "Including $j..."
cat $j >> $TARGET_FOLDER/total.txt
printf '\n\n\n' >> $TARGET_FOLDER/total.txt
done
for j in $(find $i -name "comandor-*.txt" -type f | sort); do
echo "Including $j..."
cat $j >> $TARGET_FOLDER/total.txt
printf '\n\n\n' >> $TARGET_FOLDER/total.txt
done
done