diff --git a/.github/workflows/compile.yml b/.github/workflows/compile.yml index 92f930b..f2cdecf 100644 --- a/.github/workflows/compile.yml +++ b/.github/workflows/compile.yml @@ -37,7 +37,7 @@ jobs: - name: Compile run: | - bash ./compile.sh .compiled .currpdfs + bash ./utils/compile.sh src .compiled .currpdfs - name: Generate README run: | diff --git a/compile.sh b/utils/compile.sh similarity index 93% rename from compile.sh rename to utils/compile.sh index 265a0f1..6bc9aa7 100644 --- a/compile.sh +++ b/utils/compile.sh @@ -2,8 +2,9 @@ # # Commit based .tex compiling -# $1 is the output directory. -# $2 is the directory of the current state of the files. +# $1 is the source directory. +# $2 is the output directory. +# $3 is the directory of the current state of the files. # if [ $# -eq 0 ]; then @@ -13,11 +14,11 @@ fi shopt -s globstar extglob -out_dir=`realpath $1` -old_out_dir=`realpath $2` +out_dir=`realpath $2` +old_out_dir=`realpath $3` hash_file="$old_out_dir/.hash" new_hash_file="$out_dir/.hash" -work_dir=`realpath src` +work_dir=`realpath $1` mkdir -p $out_dir touch $hash_file diff --git a/utils/update_readme.py b/utils/update_readme.py index 46625b9..042cf6a 100644 --- a/utils/update_readme.py +++ b/utils/update_readme.py @@ -20,7 +20,7 @@ if __name__ == "__main__": if METADATA_FILENAME in files: with open(os.path.join(root, METADATA_FILENAME)) as f: metadata = json.load(f) - dir_name = pathlib.PurePath(root).name + dir_name = os.path.relpath(root, args.src_path) gh_path = os.path.join(args.gh_link, dir_name) if metadata["year"] not in notes_metadata: notes_metadata[metadata["year"]] = {}