disabled log removal, del old build files on startup, shellcheck fixes
This commit is contained in:
@@ -4,26 +4,29 @@
|
|||||||
|
|
||||||
mkdir -p pdf
|
mkdir -p pdf
|
||||||
|
|
||||||
if test -f "pdf/output.aux"; then
|
# if test -f "pdf/output.aux"; then
|
||||||
rm pdf/*
|
# rm pdf/*
|
||||||
fi
|
# fi
|
||||||
latexmk -C
|
# latexmk -C
|
||||||
latexmk -pdf -jobname=pdf/output main.tex -f
|
latexmk -pdf -jobname=pdf/output main.tex -f -quiet
|
||||||
count=`ls -1 *.aux 2>/dev/null | wc -l`
|
# count=`ls -1 *.aux 2>/dev/null | wc -l`
|
||||||
if [ $count != 0 ]
|
# if [ $count != 0 ]
|
||||||
then
|
# then
|
||||||
mv *.aux pdf/
|
# mv *.aux pdf/
|
||||||
fi
|
# fi
|
||||||
count=`ls -1 *.bbl 2>/dev/null | wc -l`
|
# count=`ls -1 *.bbl 2>/dev/null | wc -l`
|
||||||
if [ $count != 0 ]
|
# if [ $count != 0 ]
|
||||||
then
|
# then
|
||||||
mv *.bbl pdf/
|
# mv *.bbl pdf/
|
||||||
fi
|
# fi
|
||||||
count=`ls -1 *.blg 2>/dev/null | wc -l`
|
# count=`ls -1 *.blg 2>/dev/null | wc -l`
|
||||||
if [ $count != 0 ]
|
# if [ $count != 0 ]
|
||||||
then
|
# then
|
||||||
mv *.blg pdf/
|
# mv *.blg pdf/
|
||||||
fi
|
# fi
|
||||||
mkdir -p pdf/log
|
# mkdir -p pdf/log
|
||||||
find pdf -maxdepth 1 -type f -not -name 'output.pdf' -exec mv {} pdf/log/ \;
|
# find pdf -maxdepth 1 -type f -not -name 'output.pdf' -exec mv {} pdf/log/ \;
|
||||||
mv pdf/output.pdf .
|
cp pdf/output.pdf .
|
||||||
|
|
||||||
|
echo ===================================
|
||||||
|
echo Done compiling.
|
||||||
|
|||||||
@@ -1,11 +1,15 @@
|
|||||||
#! /bin/bash
|
#! /bin/bash
|
||||||
|
|
||||||
# Adapted from github.com/gkilleen33/overleaf-offline under the MIT license
|
# Adapted from github.com/gkilleen33/overleaf-offline under the MIT license
|
||||||
|
|
||||||
# Add build files to gitignore
|
# CD into the main directory
|
||||||
cd /app/project
|
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
|
echo AutoLTX already installed, skipping steup
|
||||||
else
|
else
|
||||||
if test -f ".gitignore"; then
|
if test -f ".gitignore"; then
|
||||||
@@ -23,8 +27,6 @@ else
|
|||||||
touch .autoltx
|
touch .autoltx
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# mkdir -p pdf/config
|
|
||||||
|
|
||||||
# Add latexmk rc file to build files
|
# Add latexmk rc file to build files
|
||||||
cp /app/setupFiles/latexmkrc /app/project/
|
cp /app/setupFiles/latexmkrc /app/project/
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
#! /bin/bash
|
#! /bin/bash
|
||||||
|
|
||||||
echo Running as user: $USER
|
echo Running as user: "$USER"
|
||||||
|
|
||||||
if [[ -z ${1} ]]; then
|
if [[ -z ${1} ]]; then
|
||||||
echo Main file not spicified
|
echo Main file not spicified
|
||||||
echo Restart the container with proper arguments
|
echo Restart the container with proper arguments
|
||||||
exit 1
|
exit 1
|
||||||
else
|
else
|
||||||
echo Using main latex file: $1
|
echo Using main latex file: "$1"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test -d /app/project; then
|
if test -d /app/project; then
|
||||||
@@ -25,5 +25,5 @@ fi
|
|||||||
# start auto compile loop
|
# start auto compile loop
|
||||||
echo Starting AutoLTX...
|
echo Starting AutoLTX...
|
||||||
sleep 3
|
sleep 3
|
||||||
cd /app/project
|
cd /app/project || exit 2
|
||||||
ls $1 | entr -n sh -c ./compile.sh
|
ls "$1" | entr -n sh -c ./compile.sh
|
||||||
|
|||||||
Reference in New Issue
Block a user