From 1677e272e9246a2cc3a9237056d59e5a3afa147c Mon Sep 17 00:00:00 2001 From: NotXia <35894453+NotXia@users.noreply.github.com> Date: Tue, 16 Jan 2024 10:10:02 +0100 Subject: [PATCH] Update compiled file name --- compile.sh | 14 +++++++------- .../module1/{main.tex => faikr1.tex} | 0 .../module2/{main.tex => faikr2.tex} | 0 .../module3/{main.tex => faikr3.tex} | 0 .../module2/{main.tex => laai2.tex} | 0 .../{main.tex => dm-ml.tex} | 0 .../{main.tex => smm.tex} | 0 7 files changed, 7 insertions(+), 7 deletions(-) rename src/fundamentals-of-ai-and-kr/module1/{main.tex => faikr1.tex} (100%) rename src/fundamentals-of-ai-and-kr/module2/{main.tex => faikr2.tex} (100%) rename src/fundamentals-of-ai-and-kr/module3/{main.tex => faikr3.tex} (100%) rename src/languages-and-algorithms-for-ai/module2/{main.tex => laai2.tex} (100%) rename src/machine-learning-and-data-mining/{main.tex => dm-ml.tex} (100%) rename src/statistical-and-mathematical-methods-for-ai/{main.tex => smm.tex} (100%) diff --git a/compile.sh b/compile.sh index 3e47099..d908fcc 100644 --- a/compile.sh +++ b/compile.sh @@ -23,24 +23,24 @@ mkdir -p $out_dir touch $hash_file # $1: path of the directory -getDirLastHash () { +getDirLastHash() { path="$1" echo `awk -F"," "\\$1 == \"$path\" { print \\$2 } " $hash_file` } # $1: path of the directory -getDirCurrHash () { +getDirCurrHash() { path="$1" echo `git log -n 1 --format='%h' $path/**/*.!(cls)` } -getLastUpdateDate () { +getLastUpdateDate() { # Get the last update date. # Ignores .cls and commits containing "" echo `LC_ALL="en_GB.UTF-8" git log -1 --grep="" --invert-grep --pretty="format:%ad" --date="format:%d %B %Y" ./**/*.!(cls)` } -updateHashes () { +updateHashes() { cd $work_dir echo "ainotes.cls,`git log -n 1 --format='%h' ./ainotes.cls`" > $new_hash_file for f in **/[!_]*.tex; do @@ -74,18 +74,18 @@ for f in **/[!_]*.tex; do cd ${f_dir} # Save copy of source .tex - cp main.tex main.bkp.tex + cp $f_base $f_base.bkp # Insert last update date last_update=`getLastUpdateDate` - sed -i "s/PLACEHOLDER-LAST-UPDATE/${last_update}/" main.tex + sed -i "s/PLACEHOLDER-LAST-UPDATE/${last_update}/" $f_base # Compile latexmk -pdf -jobname=${f_nameonly} ${f_base} mv ${f_nameonly}.pdf $out_dir/${f_dir}/. # Restore source - mv main.bkp.tex main.tex + mv $f_base.bkp $f_base cd $work_dir done diff --git a/src/fundamentals-of-ai-and-kr/module1/main.tex b/src/fundamentals-of-ai-and-kr/module1/faikr1.tex similarity index 100% rename from src/fundamentals-of-ai-and-kr/module1/main.tex rename to src/fundamentals-of-ai-and-kr/module1/faikr1.tex diff --git a/src/fundamentals-of-ai-and-kr/module2/main.tex b/src/fundamentals-of-ai-and-kr/module2/faikr2.tex similarity index 100% rename from src/fundamentals-of-ai-and-kr/module2/main.tex rename to src/fundamentals-of-ai-and-kr/module2/faikr2.tex diff --git a/src/fundamentals-of-ai-and-kr/module3/main.tex b/src/fundamentals-of-ai-and-kr/module3/faikr3.tex similarity index 100% rename from src/fundamentals-of-ai-and-kr/module3/main.tex rename to src/fundamentals-of-ai-and-kr/module3/faikr3.tex diff --git a/src/languages-and-algorithms-for-ai/module2/main.tex b/src/languages-and-algorithms-for-ai/module2/laai2.tex similarity index 100% rename from src/languages-and-algorithms-for-ai/module2/main.tex rename to src/languages-and-algorithms-for-ai/module2/laai2.tex diff --git a/src/machine-learning-and-data-mining/main.tex b/src/machine-learning-and-data-mining/dm-ml.tex similarity index 100% rename from src/machine-learning-and-data-mining/main.tex rename to src/machine-learning-and-data-mining/dm-ml.tex diff --git a/src/statistical-and-mathematical-methods-for-ai/main.tex b/src/statistical-and-mathematical-methods-for-ai/smm.tex similarity index 100% rename from src/statistical-and-mathematical-methods-for-ai/main.tex rename to src/statistical-and-mathematical-methods-for-ai/smm.tex