md/apontamentos setup script update

This commit is contained in:
TiagoRG 2023-02-16 14:54:33 +00:00
parent a8fd220eb8
commit ace62f2de8
Signed by untrusted user who does not match committer: TiagoRG
GPG Key ID: DFCD48E3F420DB42
1 changed files with 13 additions and 4 deletions

View File

@ -9,17 +9,26 @@ then
echo "Correct usage: md [class name (may not include spaces!)]"
else
if [ "$1" == "reset" ]
then
# Reinicializa o template usando o git restore
git restore template
# Termina o script
exit 0
fi
# Cria o diretório da determinada aula
mkdir "aulas/$1"
mkdir "classes/$1"
# Copia o conteúdo da aula para o diretório respetivo
cp -a "template/out" "aulas/$1"
cp -a "template/src" "aulas/$1"
cp -a "template/out" "classes/$1"
cp -a "template/src" "classes/$1"
# Reinicializa o template usando o git restore
git restore template
# Copia o pdf da aula para a pasta que contém todos os pdf
cp "aulas/$1/out/main.pdf" "pdf"
cp "classes/$1/out/main.pdf" "pdf"
mv "pdf/main.pdf" "pdf/$1.pdf"
fi