disabled log removal, del old build files on startup, shellcheck fixes

This commit is contained in:
2025-09-16 23:05:02 +05:30
parent 46840801af
commit 98fb6893a2
3 changed files with 49 additions and 44 deletions

View File

@@ -4,26 +4,29 @@
mkdir -p pdf
if test -f "pdf/output.aux"; then
rm pdf/*
fi
latexmk -C
latexmk -pdf -jobname=pdf/output main.tex -f
count=`ls -1 *.aux 2>/dev/null | wc -l`
if [ $count != 0 ]
then
mv *.aux pdf/
fi
count=`ls -1 *.bbl 2>/dev/null | wc -l`
if [ $count != 0 ]
then
mv *.bbl pdf/
fi
count=`ls -1 *.blg 2>/dev/null | wc -l`
if [ $count != 0 ]
then
mv *.blg pdf/
fi
mkdir -p pdf/log
find pdf -maxdepth 1 -type f -not -name 'output.pdf' -exec mv {} pdf/log/ \;
mv pdf/output.pdf .
# if test -f "pdf/output.aux"; then
# rm pdf/*
# fi
# latexmk -C
latexmk -pdf -jobname=pdf/output main.tex -f -quiet
# count=`ls -1 *.aux 2>/dev/null | wc -l`
# if [ $count != 0 ]
# then
# mv *.aux pdf/
# fi
# count=`ls -1 *.bbl 2>/dev/null | wc -l`
# if [ $count != 0 ]
# then
# mv *.bbl pdf/
# fi
# count=`ls -1 *.blg 2>/dev/null | wc -l`
# if [ $count != 0 ]
# then
# mv *.blg pdf/
# fi
# mkdir -p pdf/log
# find pdf -maxdepth 1 -type f -not -name 'output.pdf' -exec mv {} pdf/log/ \;
cp pdf/output.pdf .
echo ===================================
echo Done compiling.

View File

@@ -1,11 +1,15 @@
#! /bin/bash
# Adapted from github.com/gkilleen33/overleaf-offline under the MIT license
# Add build files to gitignore
cd /app/project
# CD into the main directory
cd /app/project || exit 2
if test -f ".autoltx"; then
if test -d "pdf/"; then
rm -r pdf/
fi
# Update old installation
if test -f ".autoltxXenon"; then # Intentional wrong file name checking, to ensure the files are updated everytime the container starts. To implement version checking in later version.
echo AutoLTX already installed, skipping steup
else
if test -f ".gitignore"; then
@@ -23,8 +27,6 @@ else
touch .autoltx
fi
# mkdir -p pdf/config
# Add latexmk rc file to build files
cp /app/setupFiles/latexmkrc /app/project/

View File

@@ -1,13 +1,13 @@
#! /bin/bash
echo Running as user: $USER
echo Running as user: "$USER"
if [[ -z ${1} ]]; then
echo Main file not spicified
echo Restart the container with proper arguments
exit 1
else
echo Using main latex file: $1
echo Using main latex file: "$1"
fi
if test -d /app/project; then
@@ -25,5 +25,5 @@ fi
# start auto compile loop
echo Starting AutoLTX...
sleep 3
cd /app/project
ls $1 | entr -n sh -c ./compile.sh
cd /app/project || exit 2
ls "$1" | entr -n sh -c ./compile.sh