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