You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

62 lines
1.7 KiB
Bash

2 years ago
#!/usr/bin/env bash
for i in {1..500}
do
if [[ $i -lt 10 ]]
then
ficstring="00$i"
else
if [[ $i -lt 100 ]]
then
ficstring="0$i"
else
ficstring="$i"
fi
fi
if compgen -G "files/texts/${ficstring}.*" > /dev/null
2 years ago
then
if test -f "files/originalsmeta/${ficstring}.py"
2 years ago
then
if grep -q "^locked = True" "files/originalsmeta/${ficstring}.py"
2 years ago
then
builddir="secret"
else
if grep -q "^locked = False" "files/originalsmeta/${ficstring}.py"
2 years ago
then
builddir="files"
fi
fi
else
if test -f "files/translationsmeta/${ficstring}.py"
2 years ago
then
if grep -q "^locked = True" "files/translationsmeta/${ficstring}.py"
2 years ago
then
builddir="secret"
else
if grep -q "^locked = False" "files/translationsmeta/${ficstring}.py"
2 years ago
then
builddir="files"
fi
fi
else
builddir="null"
fi
fi
if [ ${builddir} != "null" ]
then
if test -f "files/texts/${ficstring}.html"
2 years ago
then
mv "files/texts/${ficstring}.html" "build/${builddir}/"
2 years ago
fi
if test -f "files/texts/${ficstring}.pdf"
2 years ago
then
mv "files/texts/${ficstring}.pdf" "build/${builddir}/"
2 years ago
fi
if test -f "files/texts/${ficstring}.epub"
2 years ago
then
mv "files/texts/${ficstring}.epub" "build/${builddir}/"
2 years ago
fi
fi
fi
done