aboutsummaryrefslogtreecommitdiffstats
path: root/common/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'common/scripts')
-rwxr-xr-xcommon/scripts/latex/build.sh30
-rwxr-xr-xcommon/scripts/update.sh3
2 files changed, 26 insertions, 7 deletions
diff --git a/common/scripts/latex/build.sh b/common/scripts/latex/build.sh
index 1206ee7..c67ad52 100755
--- a/common/scripts/latex/build.sh
+++ b/common/scripts/latex/build.sh
@@ -1,14 +1,30 @@
#!/usr/bin/env sh
-# if no parameter is given, use 'dst' as destination directory
-if [ -z "$1" ]; then
- dst=build
-else
- dst="$1"
-fi
+file="./%INIT_APPLICATION_NAME.tex"
+dst=build
+
+clear=false
+
+for arg in "$@"; do
+ case "$arg" in
+ "--clear")
+ clear=true
+ ;;
+ --*)
+ echo "No such option: '$arg'"
+ exit 2
+ ;;
+ *)
+ file="$arg"
+ ;;
+ esac
+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
mkdir --parents "$dst/$dir"
done
-latexmk -outdir="$dst" -file-line-error -pdflatex -recorder "./%INIT_APPLICATION_NAME.tex"
+
+test "$clear" = true && rm "$dst/${file%tex}out"
+
+latexmk -outdir="$dst" -file-line-error -pdflatex -recorder "$file"
diff --git a/common/scripts/update.sh b/common/scripts/update.sh
new file mode 100755
index 0000000..49216b8
--- /dev/null
+++ b/common/scripts/update.sh
@@ -0,0 +1,3 @@
+#!/usr/bin/env sh
+
+nix flake update