Initial commit

This commit is contained in:
2020-03-15 23:40:38 +01:00
commit f7cf161830
9 changed files with 745 additions and 0 deletions
Executable
+40
View File
@@ -0,0 +1,40 @@
#!/usr/bin/env bash
set -o pipefail
errored=0
files=$(ls | wc -l)
if [ $files -eq 1 ]; then
mv $(ls)/* .
fi
pdf_count=$(ls *.pdf 2>/dev/null | wc -l)
if [ $? -ne 0 ]; then
echo >&2 "<li>il doit y avoir un fichier PDF dans l'archive</li>"
errored=1
elif [ $pdf_count -ne 1 ]; then
echo >&2 "<li>il ne doit y avoir qu'un seul fichier PDF dans l'archive</li>"
errored=1
else
number_of_pages=$(pdfinfo *.pdf 2>/dev/null| grep Pages | cut -d ':' -f 2 | tr -d '[:space:]')
number_of_sounds=$(ls *.wav 2>/dev/null | wc -l)
if [ $? -ne 0 ]; then
echo >&2 "<li>il doit y avoir des fichiers .wav dans l'archive</li>"
errored=1
elif [ $number_of_sounds -ne $number_of_pages ]; then
echo >&2 "<li>il y a $number_of_sounds fichiers sonores mais $number_of_pages planches dans vos slides</li>"
errored=1
fi
fi
exit $errored