about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2024-10-03 16:06:25 +0200
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2024-10-03 16:06:25 +0200
commit82002250960cb445c0f88c33a62df3817f2540c1 (patch)
tree512ba6d7ebffe754edc5e975f64c5ad7c820fc6f
parentfix(template/latex/academia): Default to `report` document class (diff)
downloadflake-templates-82002250960cb445c0f88c33a62df3817f2540c1.tar.gz
flake-templates-82002250960cb445c0f88c33a62df3817f2540c1.zip
fix(common/scripts/latex/build.sh): Don't depend on the current PWD
-rwxr-xr-xcommon/scripts/latex/build.sh6
1 files changed, 4 insertions, 2 deletions
diff --git a/common/scripts/latex/build.sh b/common/scripts/latex/build.sh
index c67ad52..616a09d 100755
--- a/common/scripts/latex/build.sh
+++ b/common/scripts/latex/build.sh
@@ -1,6 +1,8 @@
 #!/usr/bin/env sh
 
-file="./%INIT_APPLICATION_NAME.tex"
+root="$(git rev-parse --show-toplevel)"
+
+file="$root/%INIT_APPLICATION_NAME.tex"
 dst=build
 
 clear=false
@@ -21,7 +23,7 @@ for arg in "$@"; do
 done
 
 # find all directories which are not the destination dir or inside it
-find . -type d -not -name "$dst" -not -path "./$dst/*" -printf '%P\n' | while IFS= read -r dir; do
+find "$root" -type d -not -name "$dst" -not -path "./$dst/*" -printf '%P\n' | while IFS= read -r dir; do
     mkdir --parents "$dst/$dir"
 done