Created the script to move the modified template to the correct class directory, move the output pdf to the 'pdf' directory containing all pdf files and after that resetting the template

This commit is contained in:
TiagoRG 2023-01-31 21:48:54 +00:00
parent 2f050b4332
commit b7e8f4a087
Signed by untrusted user who does not match committer: TiagoRG
GPG Key ID: DFCD48E3F420DB42
1 changed files with 25 additions and 0 deletions

View File

@ -0,0 +1,25 @@
# Confirma que o script está a ser executado no diretório correto
# shellcheck disable=SC2164
parent_path=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P )
cd "$parent_path"
if [ $# != 1 ]
then
# Isto executa se o comando tiver mais do que 1 argumento
echo "Correct usage: md [class name (may not include spaces!)]"
else
# Cria o diretório da determinada aula
mkdir "aulas/$1"
# Copia o conteúdo da aula para o diretório respetivo
cp -a "template/out" "aulas/$1"
cp -a "template/src" "aulas/$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"
mv "pdf/main.pdf" "pdf/$1.pdf"
fi