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