mirror of
https://github.com/NotXia/unibo-ai-notes.git
synced 2025-12-14 18:51:52 +01:00
Add no-update commit flag
This commit is contained in:
4
.gitignore
vendored
4
.gitignore
vendored
@ -5,4 +5,6 @@
|
||||
*.aux
|
||||
*.toc
|
||||
*.out
|
||||
[!_]*.pdf
|
||||
[!_]*.pdf
|
||||
|
||||
.compiled
|
||||
21
compile.sh
21
compile.sh
@ -34,6 +34,12 @@ getDirCurrHash () {
|
||||
echo `git log -n 1 --format='%h' $path/**/*.!(cls)`
|
||||
}
|
||||
|
||||
getLastUpdateDate () {
|
||||
# Get the last update date.
|
||||
# Ignores .cls and commits containing "<noupdate>"
|
||||
echo `LC_ALL="en_GB.UTF-8" git log -1 --grep="<noupdate>" --invert-grep --pretty="format:%ad" --date="format:%d %B %Y" ./**/*.!(cls)`
|
||||
}
|
||||
|
||||
updateHashes () {
|
||||
cd $work_dir
|
||||
echo "ainotes.cls,`git log -n 1 --format='%h' ./ainotes.cls`" > $new_hash_file
|
||||
@ -65,15 +71,22 @@ for f in **/[!_]*.tex; do
|
||||
continue
|
||||
fi
|
||||
|
||||
cd ${f_dir};
|
||||
cd ${f_dir}
|
||||
|
||||
# Save copy of source .tex
|
||||
cp main.tex main.bkp.tex
|
||||
|
||||
# Insert last update date
|
||||
last_update=`LC_ALL="en_GB.UTF-8" git log -1 --pretty="format:%ad" --date="format:%d %B %Y" ./**/*.!(cls)`
|
||||
cp --remove-destination $(readlink ainotes.cls) ainotes.cls
|
||||
sed -i "s/PLACEHOLDER-LAST-UPDATE/${last_update}/" ainotes.cls
|
||||
last_update=`getLastUpdateDate`
|
||||
sed -i "s/PLACEHOLDER-LAST-UPDATE/${last_update}/" main.tex
|
||||
|
||||
# Compile
|
||||
latexmk -pdf -jobname=${f_nameonly} ${f_base}
|
||||
mv ${f_nameonly}.pdf $out_dir/${f_dir}/.
|
||||
|
||||
# Restore source
|
||||
mv main.bkp.tex main.tex
|
||||
|
||||
cd $work_dir
|
||||
done
|
||||
|
||||
|
||||
Reference in New Issue
Block a user