31 lines
724 B
Bash
31 lines
724 B
Bash
|
#!/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
|